This repository has been archived by the owner on May 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Daishan Peng
committed
Nov 6, 2017
1 parent
6a3da49
commit c8a3a30
Showing
1 changed file
with
29 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash -e | ||
|
||
source $(dirname $0)/version | ||
|
||
cd $(dirname $0)/.. | ||
|
||
OS_PLATFORM_ARG=(linux darwin windows) | ||
OS_ARCH_ARG[linux]="amd64 arm" | ||
OS_ARCH_ARG[windows]="386 amd64" | ||
OS_ARCH_ARG[darwin]="amd64" | ||
|
||
CGO_ENABLED=0 go build -o bin/kontainer-engine | ||
|
||
if [ -n "$CROSS" ]; then | ||
rm -rf build/bin | ||
mkdir -p build/bin | ||
for OS in ${OS_PLATFORM_ARG[@]}; do | ||
for ARCH in ${OS_ARCH_ARG[${OS}]}; do | ||
OUTPUT_BIN="build/bin/kontainer-engine_$OS-$ARCH" | ||
if test "$OS" = "windows"; then | ||
OUTPUT_BIN="${OUTPUT_BIN}.exe" | ||
fi | ||
echo "Building binary for $OS/$ARCH..." | ||
GOARCH=$ARCH GOOS=$OS CGO_ENABLED=0 go build \ | ||
-ldflags="-w -X main.VERSION=$VERSION" \ | ||
-o ${OUTPUT_BIN} ./ | ||
done | ||
done | ||
fi |