Add environment variable option to skip docker build

Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
This commit is contained in:
Nathan LeClaire 2015-05-05 14:26:24 -07:00
parent 10afd2da8a
commit f1c7577f82
2 changed files with 12 additions and 1 deletions

View File

@ -38,6 +38,12 @@ run:
$ script/build -osarch="darwin/amd64"
If you don't need to run the `docker build` to generate the image on each
compile, i.e. if you have built the image already, you can skip the image build
using the `SKIP_BUILD` environment variable, for instance:
$ SKIP_BUILD=1 script/build -osarch="darwin/amd64"
If you have any questions we're in #docker-machine on Freenode.
## Unit Tests

View File

@ -13,6 +13,11 @@ else
OS_ARCH_ARG=($2)
fi
docker build -t docker-machine .
# Build Docker image unless we opt out of it
if [[ -z "$SKIP_BUILD" ]]; then
docker build -t docker-machine .
fi
# Get rid of existing binaries
rm -f docker-machine*
docker run --rm -v `pwd`:/go/src/github.com/docker/machine docker-machine gox "${OS_PLATFORM_ARG[@]}" "${OS_ARCH_ARG[@]}" -output="docker-machine_{{.OS}}-{{.Arch}}" -ldflags="-w -X github.com/docker/machine/version.GITCOMMIT `git rev-parse --short HEAD`"