summaryrefslogtreecommitdiffstats
path: root/build.sh
diff options
context:
space:
mode:
authorJakob Borg <jakob@nym.se>2015-08-09 14:40:18 +0200
committerJakob Borg <jakob@nym.se>2015-08-09 14:40:18 +0200
commita2f73a7d35933b3ae8a08740f12dc9e356b0d80a (patch)
tree764e8f0cdafc8ff8165aed3b9c2320162f87ced1 /build.sh
parent1492e57676bab34e119b3b3f032c74ea36988cee (diff)
Allow specifying Docker image to use for building
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh12
1 files changed, 8 insertions, 4 deletions
diff --git a/build.sh b/build.sh
index 2401476fc..0ca2c0691 100755
--- a/build.sh
+++ b/build.sh
@@ -123,11 +123,12 @@ case "${1:-default}" in
;;
docker-all)
+ img=${DOCKERIMG:-syncthing/build:latest}
docker run --rm -h syncthing-builder -u $(id -u) -t \
-v $(pwd):/go/src/github.com/syncthing/syncthing \
-w /go/src/github.com/syncthing/syncthing \
-e "STTRACE=$STTRACE" \
- syncthing/build:latest \
+ "$img" \
sh -c './build.sh clean \
&& ./build.sh test-cov \
&& ./build.sh bench \
@@ -135,11 +136,12 @@ case "${1:-default}" in
;;
docker-test)
+ img=${DOCKERIMG:-syncthing/build:latest}
docker run --rm -h syncthing-builder -u $(id -u) -t \
-v $(pwd):/go/src/github.com/syncthing/syncthing \
-w /go/src/github.com/syncthing/syncthing \
-e "STTRACE=$STTRACE" \
- syncthing/build:latest \
+ "$img" \
sh -euxc './build.sh clean \
&& go run build.go -race \
&& export GOPATH=$(pwd)/Godeps/_workspace:$GOPATH \
@@ -149,21 +151,23 @@ case "${1:-default}" in
;;
docker-lint)
+ img=${DOCKERIMG:-syncthing/build:latest}
docker run --rm -h syncthing-builder -u $(id -u) -t \
-v $(pwd):/go/src/github.com/syncthing/syncthing \
-w /go/src/github.com/syncthing/syncthing \
-e "STTRACE=$STTRACE" \
- syncthing/build:latest \
+ "$img" \
sh -euxc 'go run build.go lint'
;;
docker-vet)
+ img=${DOCKERIMG:-syncthing/build:latest}
docker run --rm -h syncthing-builder -u $(id -u) -t \
-v $(pwd):/go/src/github.com/syncthing/syncthing \
-w /go/src/github.com/syncthing/syncthing \
-e "STTRACE=$STTRACE" \
- syncthing/build:latest \
+ "$img" \
sh -euxc 'go run build.go vet'
;;