Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Travis CI integration #6

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
11 changes: 11 additions & 0 deletions .ci-scripts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Scripts for Continuous Integration
==================================

The scripts in this folder are designed to be integrated in Travis-CI.

They map the main hooks provided by Travis-CI, so that forkers can customize their processes.

For example, Golang forks of `go get`able repos can use before_install.sh to avoid `go get` of
upstream imports, using an environment variable UPSTREAM_OWNER containing the Github name of
the owner of the upstream repo.

1 change: 1 addition & 0 deletions .ci-scripts/after_failure.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#!/bin/true
1 change: 1 addition & 0 deletions .ci-scripts/after_script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#!/bin/true
1 change: 1 addition & 0 deletions .ci-scripts/after_success.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#!/bin/true
17 changes: 17 additions & 0 deletions .ci-scripts/before_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

set -x

if [ "$TRAVIS_GO_VERSION" = "tip" ]; then
go get github.com/axw/gocov/gocov
go get github.com/mattn/goveralls
if ! go get code.google.com/p/go.tools/cmd/cover; then
go get golang.org/x/tools/cmd/cover;
fi
fi

if [ "$UPSTREAM_OWNER" != "" ]; then
REPO_NAME=`basename $TRAVIS_REPO_SLUG`
mkdir ../../$UPSTREAM_OWNER && ln -s `pwd` ../../$UPSTREAM_OWNER/$REPO_NAME
fi

1 change: 1 addition & 0 deletions .ci-scripts/before_script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#!/bin/true
5 changes: 5 additions & 0 deletions .ci-scripts/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

set -x

go get -v ./...
9 changes: 9 additions & 0 deletions .ci-scripts/script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

set -x

if [ "$TRAVIS_GO_VERSION" = "tip" ]; then
goveralls -service=travis-ci;
else
go test ./...;
fi
21 changes: 21 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
language: go
go:
- 1.1
- 1.2
- 1.3
- release
- tip
before_install:
- .ci-scripts/before_install.sh
install:
- .ci-scripts/install.sh
before_script:
- .ci-scripts/before_script.sh
script:
- .ci-scripts/script.sh
after_success:
- .ci-scripts/after_succeess.sh
after_failure:
- .ci-scripts/after_failure.sh
after_script:
- .ci-scripts/after_script.sh
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
[![Build Status](https://travis-ci.org/rminnich/go9p.svg?branch=master)](https://travis-ci.org/rminnich/go9p)
[![Coverage Status](https://coveralls.io/repos/rminnich/go9p/badge.svg?branch=master&service=github)](https://coveralls.io/github/rminnich/go9p)

This is go9p done in a way that I can understand.

To install:
export GOPATH=~rminnich/go
go get -a github.com/rminnich/go9p
go get -a github.com/rminnich/go9p/ufs
go install -a github.com/rminnich/go9p/ufs

~/go/bin/ufs
export GOPATH=~/go
go get -a github.com/rminnich/go9p
go get -a github.com/rminnich/go9p/ufs
go install -a github.com/rminnich/go9p/ufs

Then to start serving the root fs via 9p at port 5640:

~/go/bin/ufs