Tom Wieczorek 853b82d19f
build: Use POSIX sh for shell scripts
The scripts didn't really use any bash specific features. Convert
them to POSIX shell scripts, so that the plugins can be built without
requiring bash.

Signed-off-by: Tom Wieczorek <twieczorek@mirantis.com>
2023-09-29 16:57:19 +02:00

24 lines
468 B
Bash
Executable File

#!/usr/bin/env sh
set -e
cd "$(dirname "$0")"
if [ "$(uname)" = "Darwin" ]; then
export GOOS="${GOOS:-linux}"
fi
export GOFLAGS="${GOFLAGS} -mod=vendor"
mkdir -p "${PWD}/bin"
echo "Building plugins ${GOOS}"
PLUGINS="plugins/meta/* plugins/main/* plugins/ipam/*"
for d in $PLUGINS; do
if [ -d "$d" ]; then
plugin="$(basename "$d")"
if [ "${plugin}" != "windows" ]; then
echo " $plugin"
${GO:-go} build -o "${PWD}/bin/$plugin" "$@" ./"$d"
fi
fi
done