File: build

package info (click to toggle)
golang-github-appc-cni 0.3.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 484 kB
  • ctags: 342
  • sloc: sh: 172; makefile: 6
file content (30 lines) | stat: -rwxr-xr-x 647 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/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 GOBIN=${PWD}/bin
export GOPATH=${PWD}/gopath

echo "Building API"
go build "$@" ${REPO_PATH}/libcni

echo "Building reference CLI"
go install "$@" ${REPO_PATH}/cnitool

echo "Building plugins"
PLUGINS="plugins/meta/* plugins/main/* plugins/ipam/*"
for d in $PLUGINS; do
	if [ -d $d ]; then
		plugin=$(basename $d)
		echo "  " $plugin
		go install "$@" ${REPO_PATH}/$d
	fi
done