2015-03-30 10:51:56 +03:00
|
|
|
#!/bin/bash -ex
|
2014-03-04 16:36:05 -08:00
|
|
|
|
2015-03-28 20:08:30 +03:00
|
|
|
ORG_PATH="github.com/vtolstov"
|
|
|
|
REPO_PATH="${ORG_PATH}/cloudinit"
|
2014-05-10 01:42:57 -07:00
|
|
|
|
2014-03-04 16:36:05 -08:00
|
|
|
export GOBIN=${PWD}/bin
|
2015-03-28 20:04:09 +03:00
|
|
|
export GOPATH=${PWD}/third_party
|
2015-03-27 09:23:31 +03:00
|
|
|
export CGO_ENABLED=0
|
2015-03-30 12:05:49 +03:00
|
|
|
mkdir -p $GOBIN
|
2014-03-04 16:36:05 -08:00
|
|
|
|
2015-03-30 10:51:56 +03:00
|
|
|
if [ ! -h $GOPATH/src/${REPO_PATH} ]; then
|
|
|
|
mkdir -p $GOPATH/src/${ORG_PATH}
|
|
|
|
ln -s ../../../.. $GOPATH/src/${REPO_PATH} || echo "exit 255"
|
|
|
|
fi
|
|
|
|
|
2015-03-28 20:04:09 +03:00
|
|
|
for os in linux freebsd; do
|
2015-03-30 12:05:49 +03:00
|
|
|
GOOS=${os} go build -x -a -installsuffix cgo -o bin/cloudinit-${os}-x86_64 ${REPO_PATH}
|
|
|
|
GOOS=${os} GOARCH=386 go build -x -a -installsuffix cgo -o bin/cloudinit-${os}-x86_32 ${REPO_PATH}
|
2015-03-28 20:04:09 +03:00
|
|
|
done
|