Skip to content

Commit

Permalink
build: Update the build script to make it possible to build for other…
Browse files Browse the repository at this point in the history
… architectures

This makes it possible to cross-compile cni like so:
$ GOARCH=arm ./build
$ GOARCH=arm64 ./build
$ GOARCH=ppc64le ./build

ref containernetworking#209
  • Loading branch information
luxas committed Jul 3, 2016
1 parent 5006aac commit 273b9ab
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,20 @@ if [ ! -h gopath/src/${REPO_PATH} ]; then
fi

export GO15VENDOREXPERIMENT=1
export GOBIN=${PWD}/bin
export GOPATH=${PWD}/gopath

echo "Building API"
go build "$@" ${REPO_PATH}/libcni

echo "Building reference CLI"
go install "$@" ${REPO_PATH}/cnitool
go build -o ${PWD}/bin/cnitool "$@" ${REPO_PATH}/cnitool

echo "Building plugins"
PLUGINS="plugins/meta/* plugins/main/* plugins/ipam/*"
for d in $PLUGINS; do
if [ -d $d ]; then
plugin=$(basename $d)
echo " " $plugin
go install "$@" ${REPO_PATH}/$d
go build -o ${PWD}/bin/$plugin "$@" ${REPO_PATH}/$d
fi
done
2 changes: 1 addition & 1 deletion test
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ TEST=${split[@]/#/${REPO_PATH}/}

echo -n "Running tests "
function testrun {
sudo -E bash -c "umask 0; PATH=$GOROOT/bin:$GOBIN:$PATH go test -covermode set $@"
sudo -E bash -c "umask 0; PATH=$GOROOT/bin:$(pwd)/bin:$PATH go test -covermode set $@"
}
if [ ! -z "${COVERALLS}" ]; then
echo "with coverage profile generation..."
Expand Down

0 comments on commit 273b9ab

Please sign in to comment.