Merge pull request #394 from ehazlett/build-enable-arch-flag

enable specifying arch along with os when building
This commit is contained in:
Evan Hazlett 2015-01-23 14:42:10 -05:00
commit e819eb2fc7
1 changed files with 9 additions and 3 deletions

View File

@ -2,11 +2,17 @@
set -e
if [ -z "$1" ]; then
OS_ARCH_ARG=(-os="darwin linux windows")
OS_PLATFORM_ARG=(-os="darwin linux windows")
else
OS_ARCH_ARG=($1)
OS_PLATFORM_ARG=($1)
fi
if [ -z "$2" ]; then
OS_ARCH_ARG=(-arch="386 amd64")
else
OS_ARCH_ARG=($2)
fi
rm -f docker-machine*
docker build -t docker-machine .
exec docker run --rm -v `pwd`:/go/src/github.com/docker/machine docker-machine gox "${OS_ARCH_ARG[@]}" -output="docker-machine_{{.OS}}-{{.Arch}}"
exec 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}}"