2016-01-27 09:25:53 +00:00
|
|
|
#!/usr/bin/env bash
|
2016-05-20 10:38:19 +00:00
|
|
|
set -e
|
2015-04-15 22:35:02 +00:00
|
|
|
|
2016-05-04 14:06:05 +00:00
|
|
|
ORG_PATH="github.com/containernetworking"
|
2015-04-15 22:35:02 +00:00
|
|
|
REPO_PATH="${ORG_PATH}/cni"
|
|
|
|
|
|
|
|
if [ ! -h gopath/src/${REPO_PATH} ]; then
|
|
|
|
mkdir -p gopath/src/${ORG_PATH}
|
|
|
|
ln -s ../../../.. gopath/src/${REPO_PATH} || exit 255
|
|
|
|
fi
|
|
|
|
|
2016-03-24 16:33:19 +00:00
|
|
|
export GO15VENDOREXPERIMENT=1
|
2016-03-21 15:34:07 +00:00
|
|
|
export GOPATH=${PWD}/gopath
|
2015-04-15 22:35:02 +00:00
|
|
|
|
2015-08-07 15:27:52 +00:00
|
|
|
echo "Building API"
|
2016-04-28 20:40:59 +00:00
|
|
|
go build "$@" ${REPO_PATH}/libcni
|
2015-08-07 15:27:52 +00:00
|
|
|
|
|
|
|
echo "Building reference CLI"
|
2016-08-13 09:44:28 +00:00
|
|
|
go build -o ${PWD}/bin/cnitool "$@" ${REPO_PATH}/cnitool
|
2015-08-07 15:27:52 +00:00
|
|
|
|
2015-04-15 22:35:02 +00:00
|
|
|
echo "Building plugins"
|
2016-07-14 20:59:10 +00:00
|
|
|
PLUGINS="plugins/meta/* plugins/main/* plugins/ipam/* plugins/test/*"
|
2015-04-15 22:35:02 +00:00
|
|
|
for d in $PLUGINS; do
|
|
|
|
if [ -d $d ]; then
|
|
|
|
plugin=$(basename $d)
|
|
|
|
echo " " $plugin
|
2016-08-13 09:44:28 +00:00
|
|
|
go build -o ${PWD}/bin/$plugin "$@" ${REPO_PATH}/$d
|
2015-04-15 22:35:02 +00:00
|
|
|
fi
|
|
|
|
done
|