Created
October 9, 2015 14:03
-
-
Save truongsinh/4dcec348b37defa11236 to your computer and use it in GitHub Desktop.
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
before_script: | |
- export GOPATH=$(pwd) | |
stages: | |
- build | |
- test | |
- deploy | |
validate-schema: | |
image: truongsinh/pg-client:9.4 | |
services: | |
- postgres:9.4 | |
stage: build | |
script: | |
- sql/validate.sh | |
format: | |
image: golang:1.5 | |
stage: build | |
script: | |
- go get golang.org/x/tools/cmd/goimports | |
# If formatted is different than committed, exit with error | |
# goimports -w src/smarpshare/ | |
- (if [ "$(bin/goimports -d src/smarpshare/)" == "" ]; then echo "Good format"; else echo "Bad format"; exit 33; fi); | |
# goimports -w src/*.go | |
- (if [ "$(bin/goimports -d src/*.go)" == "" ]; then echo "Good format"; else echo "Bad format"; exit 33; fi); | |
vet: | |
image: golang:1.5 | |
stage: build | |
script: | |
# Vet dir src/smarpshare, dont care about unkeyed composites | |
- go tool vet -composites=false src/smarpshare | |
# Vet files in src/, dont care about unkeyed composites | |
- go tool vet -composites=false -shadow=true src/*.go | |
compile-go-1.4: | |
image: golang:1.4 | |
stage: build | |
script: | |
- git submodule update --init | |
# Cannot use go build src/*.go | |
# Loop through src/*.go, go build, if exit code is not 0, then exit 66 | |
- (for f in src/*.go; do echo "-> go build $f"; go build $f; if [ $? -ne 0 ]; then exit 66; fi; done); | |
compile-go-1.5: | |
image: golang:1.5 | |
stage: build | |
script: | |
- git submodule update --init | |
# Cannot use go build src/*.go | |
# Loop through src/*.go, go build, if exit code is not 0, then exit 66 | |
- (for f in src/*.go; do echo "-> go build $f"; go build $f; if [ $? -ne 0 ]; then exit 66; fi; done); | |
test-go-1.4: | |
image: golang:1.4 | |
services: | |
- postgres:9.4 | |
- truongsinh/rethinkdb:2.1.3 | |
stage: test | |
script: | |
- git submodule update --init | |
- go run sql/latest_schema.sql.go | |
- go test -race -p 1 smarpshare/... | |
test-go-1.5-no-race: | |
image: golang:1.5 | |
services: | |
- postgres:9.4 | |
- truongsinh/rethinkdb:2.1.3 | |
stage: test | |
script: | |
- git submodule update --init | |
- go run sql/latest_schema.sql.go | |
- go test -p 1 smarpshare/... | |
test-go-1.5: | |
image: golang:1.5 | |
services: | |
- postgres:9.4 | |
- truongsinh/rethinkdb:2.1.3 | |
stage: test | |
script: | |
- git submodule update --init | |
- go run sql/latest_schema.sql.go | |
- go test -race -p 1 smarpshare/... | |
allow_failure: true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello Can you help me, I want to execute git clone command conditionally,
I want
- (if [!-d /var/www/html/.git]; then git clone http://username:[email protected]/root/myproject.git /var/www/html exit 33; fi)
in below code.Thanks in Advance