Allow specifying Docker image to use for building

This commit is contained in:
Jakob Borg 2015-08-09 14:40:18 +02:00
parent 1492e57676
commit a2f73a7d35

View File

@ -123,11 +123,12 @@ case "${1:-default}" in
;; ;;
docker-all) docker-all)
img=${DOCKERIMG:-syncthing/build:latest}
docker run --rm -h syncthing-builder -u $(id -u) -t \ docker run --rm -h syncthing-builder -u $(id -u) -t \
-v $(pwd):/go/src/github.com/syncthing/syncthing \ -v $(pwd):/go/src/github.com/syncthing/syncthing \
-w /go/src/github.com/syncthing/syncthing \ -w /go/src/github.com/syncthing/syncthing \
-e "STTRACE=$STTRACE" \ -e "STTRACE=$STTRACE" \
syncthing/build:latest \ "$img" \
sh -c './build.sh clean \ sh -c './build.sh clean \
&& ./build.sh test-cov \ && ./build.sh test-cov \
&& ./build.sh bench \ && ./build.sh bench \
@ -135,11 +136,12 @@ case "${1:-default}" in
;; ;;
docker-test) docker-test)
img=${DOCKERIMG:-syncthing/build:latest}
docker run --rm -h syncthing-builder -u $(id -u) -t \ docker run --rm -h syncthing-builder -u $(id -u) -t \
-v $(pwd):/go/src/github.com/syncthing/syncthing \ -v $(pwd):/go/src/github.com/syncthing/syncthing \
-w /go/src/github.com/syncthing/syncthing \ -w /go/src/github.com/syncthing/syncthing \
-e "STTRACE=$STTRACE" \ -e "STTRACE=$STTRACE" \
syncthing/build:latest \ "$img" \
sh -euxc './build.sh clean \ sh -euxc './build.sh clean \
&& go run build.go -race \ && go run build.go -race \
&& export GOPATH=$(pwd)/Godeps/_workspace:$GOPATH \ && export GOPATH=$(pwd)/Godeps/_workspace:$GOPATH \
@ -149,21 +151,23 @@ case "${1:-default}" in
;; ;;
docker-lint) docker-lint)
img=${DOCKERIMG:-syncthing/build:latest}
docker run --rm -h syncthing-builder -u $(id -u) -t \ docker run --rm -h syncthing-builder -u $(id -u) -t \
-v $(pwd):/go/src/github.com/syncthing/syncthing \ -v $(pwd):/go/src/github.com/syncthing/syncthing \
-w /go/src/github.com/syncthing/syncthing \ -w /go/src/github.com/syncthing/syncthing \
-e "STTRACE=$STTRACE" \ -e "STTRACE=$STTRACE" \
syncthing/build:latest \ "$img" \
sh -euxc 'go run build.go lint' sh -euxc 'go run build.go lint'
;; ;;
docker-vet) docker-vet)
img=${DOCKERIMG:-syncthing/build:latest}
docker run --rm -h syncthing-builder -u $(id -u) -t \ docker run --rm -h syncthing-builder -u $(id -u) -t \
-v $(pwd):/go/src/github.com/syncthing/syncthing \ -v $(pwd):/go/src/github.com/syncthing/syncthing \
-w /go/src/github.com/syncthing/syncthing \ -w /go/src/github.com/syncthing/syncthing \
-e "STTRACE=$STTRACE" \ -e "STTRACE=$STTRACE" \
syncthing/build:latest \ "$img" \
sh -euxc 'go run build.go vet' sh -euxc 'go run build.go vet'
;; ;;