2018-11-01 16:14:18 -04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -e
|
2020-12-08 14:22:21 +01:00
|
|
|
cd "$(dirname "$0")"
|
2018-11-01 16:14:18 -04:00
|
|
|
|
|
|
|
if [ "$(uname)" == "Darwin" ]; then
|
|
|
|
export GOOS="${GOOS:-linux}"
|
|
|
|
fi
|
|
|
|
|
2019-06-17 21:33:01 -07:00
|
|
|
export GOFLAGS="${GOFLAGS} -mod=vendor"
|
2018-11-01 16:14:18 -04:00
|
|
|
|
|
|
|
mkdir -p "${PWD}/bin"
|
|
|
|
|
|
|
|
echo "Building plugins ${GOOS}"
|
2019-04-15 16:17:43 +02:00
|
|
|
PLUGINS="plugins/meta/* plugins/main/* plugins/ipam/*"
|
2018-11-01 16:14:18 -04:00
|
|
|
for d in $PLUGINS; do
|
|
|
|
if [ -d "$d" ]; then
|
|
|
|
plugin="$(basename "$d")"
|
2020-12-08 14:22:21 +01:00
|
|
|
if [ "${plugin}" != "windows" ]; then
|
2018-11-01 16:14:18 -04:00
|
|
|
echo " $plugin"
|
2020-12-08 14:22:21 +01:00
|
|
|
${GO:-go} build -o "${PWD}/bin/$plugin" "$@" ./"$d"
|
2018-11-01 16:14:18 -04:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|