Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
add test build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Daishan Peng committed Nov 6, 2017
1 parent 6a3da49 commit c8a3a30
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions scripts/build_native_test
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

0 comments on commit c8a3a30

Please sign in to comment.