Rename build script to avoid conflict with bazel
It's difficult to include this repository using bazel, because the file named "build" conflicts with new_go_repository generation on case-insensitive filesystems (ref https://github.com/bazelbuild/rules_go/issues/234). This change renames the file to something that doesn't conflict, and also renames the test script for consistency.
This commit is contained in:
29
build.sh
Executable file
29
build.sh
Executable file
@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
ORG_PATH="github.com/containernetworking"
|
||||
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
|
||||
|
||||
export GO15VENDOREXPERIMENT=1
|
||||
export GOPATH=${PWD}/gopath
|
||||
|
||||
echo "Building API"
|
||||
go build "$@" ${REPO_PATH}/libcni
|
||||
|
||||
echo "Building reference CLI"
|
||||
go build -o ${PWD}/bin/cnitool "$@" ${REPO_PATH}/cnitool
|
||||
|
||||
echo "Building plugins"
|
||||
PLUGINS="plugins/meta/* plugins/main/* plugins/ipam/* plugins/test/*"
|
||||
for d in $PLUGINS; do
|
||||
if [ -d $d ]; then
|
||||
plugin=$(basename $d)
|
||||
echo " " $plugin
|
||||
go build -o ${PWD}/bin/$plugin "$@" ${REPO_PATH}/$d
|
||||
fi
|
||||
done
|
Reference in New Issue
Block a user