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