This repository has been archived by the owner on Sep 26, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
- Loading branch information
1 parent
02ef855
commit 28831d1
Showing
3 changed files
with
31 additions
and
36 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,20 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
if [ -z "$1" ]; then | ||
OS_PLATFORM_ARG=(-os="darwin linux windows") | ||
else | ||
OS_PLATFORM_ARG=($1) | ||
fi | ||
|
||
if [ -z "$2" ]; then | ||
OS_ARCH_ARG=(-arch="386 amd64 arm") | ||
else | ||
OS_ARCH_ARG=($2) | ||
fi | ||
BUILD_IMAGE_NAME="docker-machine-build" | ||
GOOS=${GOOS:-"darwin linux windows"} | ||
GOARCH=${GOARCH:-"386 amd64 arm"} | ||
|
||
# Build Docker image unless we opt out of it | ||
if [[ -z "$SKIP_BUILD" ]]; then | ||
docker build -t docker-machine . | ||
# Build image for compilation if not detected | ||
if [[ $(docker images -q ${BUILD_IMAGE_NAME} | wc -l) -ne 1 ]]; then | ||
docker build -t ${BUILD_IMAGE_NAME} . | ||
fi | ||
|
||
# Get rid of existing binaries | ||
rm -f docker-machine* | ||
rm -rf Godeps/_workspace/pkg | ||
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`" | ||
docker run --rm \ | ||
-v `pwd`:/go/src/github.com/docker/machine \ | ||
${BUILD_IMAGE_NAME} \ | ||
gox \ | ||
-os "$GOOS" \ | ||
-arch "$GOARCH" \ | ||
-output="docker-machine_{{.OS}}-{{.Arch}}" \ | ||
-ldflags="-w -X github.com/docker/machine/version.GitCommit `git rev-parse --short HEAD`" |