build 647 B

12345678910111213141516171819202122232425262728293031
  1. #!/usr/bin/env bash
  2. set -e
  3. ORG_PATH="github.com/containernetworking"
  4. REPO_PATH="${ORG_PATH}/cni"
  5. if [ ! -h gopath/src/${REPO_PATH} ]; then
  6. mkdir -p gopath/src/${ORG_PATH}
  7. ln -s ../../../.. gopath/src/${REPO_PATH} || exit 255
  8. fi
  9. export GO15VENDOREXPERIMENT=1
  10. export GOBIN=${PWD}/bin
  11. export GOPATH=${PWD}/gopath
  12. echo "Building API"
  13. go build "$@" ${REPO_PATH}/libcni
  14. echo "Building reference CLI"
  15. go install "$@" ${REPO_PATH}/cnitool
  16. echo "Building plugins"
  17. PLUGINS="plugins/meta/* plugins/main/* plugins/ipam/*"
  18. for d in $PLUGINS; do
  19. if [ -d $d ]; then
  20. plugin=$(basename $d)
  21. echo " " $plugin
  22. go install "$@" ${REPO_PATH}/$d
  23. fi
  24. done