Created
September 22, 2012 03:38
-
-
Save bluesalt/3765035 to your computer and use it in GitHub Desktop.
shell script for gorouter ci job
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export PATH=$VCAP_RUBY19/bin:$PATH | |
GOLANG_PATH=`readlink -nf /var/vcap/packages/golang` | |
GO2XUNIT_DIR=`readlink -nf /var/vcap/packages/go2xunit` | |
VCAP_RUBY19_REALPATH=`readlink -nf $VCAP_RUBY19` | |
export PATH=$GOLANG_PATH/bin:$PATH | |
GIT_REALPATH=`readlink -nf /var/vcap/packages/git` | |
GOROUTER_DIR=$PWD/ | |
cd /var/vcap/packages/golang | |
rm -rvf $GOROUTER_DIR/ci_result | |
TEST_RUNNER=`mktemp` | |
cat <<-EOT > $TEST_RUNNER | |
#!/bin/bash | |
set -o errexit | |
set -o nounset | |
export PATH=$VCAP_RUBY19_REALPATH/bin:$GIT_REALPATH/bin:$PATH | |
cd /tmp/ | |
mkdir ci_result | |
export GOROOT=`readlink -nf /var/vcap/packages/golang` | |
export GOPATH=/tmp | |
go get github.com/cloudfoundry/gonats | |
wget https://github.com/downloads/jeffleefd/gocheck/gorouterlibs.zip | |
unzip -o gorouterlibs.zip | |
cd src/metrics | |
go install | |
cd ../launchpad.net/gocheck | |
go install | |
cd ../goyaml | |
go install | |
cd ../../code.google.com/p/go.net/websocket | |
go install | |
cd /tmp/ | |
go test -i | |
go test -v | go run "$GO2XUNIT_DIR/go2xunit.go" -output="ci_result/tests.xml" | |
EOT | |
HANDLE=`$CREATE_CONTAINER $VCAP_RUBY19_REALPATH $GO2XUNIT_DIR $GOLANG_PATH $GIT_REALPATH` | |
$WARDEN_REPL -c " | |
copy $HANDLE in $GOROUTER_DIR /tmp | |
copy $HANDLE in $TEST_RUNNER /tmp | |
run $HANDLE chmod +x $TEST_RUNNER | |
run $HANDLE $TEST_RUNNER | |
copy $HANDLE out /tmp/ $GOROUTER_DIR vcap:vcap | |
destroy $HANDLE | |
" | |
rm -f $TEST_RUNNER |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment