2017-03-13 17:05:55 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -e
|
|
|
|
|
|
|
|
ORG_PATH="github.com/containernetworking"
|
2017-04-19 04:39:09 +00:00
|
|
|
export REPO_PATH="${ORG_PATH}/plugins"
|
2017-03-13 17:05:55 +00:00
|
|
|
|
|
|
|
if [ ! -h gopath/src/${REPO_PATH} ]; then
|
|
|
|
mkdir -p gopath/src/${ORG_PATH}
|
|
|
|
ln -s ../../../.. gopath/src/${REPO_PATH} || exit 255
|
|
|
|
fi
|
|
|
|
|
|
|
|
export GO15VENDOREXPERIMENT=1
|
|
|
|
export GOPATH=${PWD}/gopath
|
|
|
|
|
2017-05-03 17:07:29 +00:00
|
|
|
mkdir -p "${PWD}/bin"
|
2017-03-13 17:05:55 +00:00
|
|
|
|
|
|
|
echo "Building plugins"
|
2017-05-10 03:17:30 +00:00
|
|
|
PLUGINS="plugins/sample plugins/main/vlan"
|
2017-03-13 17:05:55 +00:00
|
|
|
for d in $PLUGINS; do
|
2017-05-03 17:07:29 +00:00
|
|
|
if [ -d "$d" ]; then
|
|
|
|
plugin="$(basename "$d")"
|
|
|
|
echo " $plugin"
|
2017-03-13 17:05:55 +00:00
|
|
|
# use go install so we don't duplicate work
|
2017-05-03 17:07:29 +00:00
|
|
|
go build -o "${PWD}/bin/$plugin" -pkgdir "$GOPATH/pkg" "$@" "$REPO_PATH/$d"
|
2017-03-13 17:05:55 +00:00
|
|
|
fi
|
|
|
|
done
|