2014-03-05 04:36:05 +04:00
|
|
|
#!/bin/bash -e
|
|
|
|
|
2015-08-12 20:53:32 +03:00
|
|
|
NAME="coreos-cloudinit"
|
2014-05-10 12:42:57 +04:00
|
|
|
ORG_PATH="github.com/coreos"
|
2015-08-12 20:53:32 +03:00
|
|
|
REPO_PATH="${ORG_PATH}/${NAME}"
|
|
|
|
VERSION=$(git describe --dirty --tags)
|
|
|
|
GLDFLAGS="-X main.version \"${VERSION}\""
|
2014-05-10 12:42:57 +04:00
|
|
|
|
2014-05-22 22:37:19 +04:00
|
|
|
if [ ! -h gopath/src/${REPO_PATH} ]; then
|
|
|
|
mkdir -p gopath/src/${ORG_PATH}
|
|
|
|
ln -s ../../../.. gopath/src/${REPO_PATH} || exit 255
|
|
|
|
fi
|
|
|
|
|
2014-03-05 04:36:05 +04:00
|
|
|
export GOBIN=${PWD}/bin
|
2014-05-22 22:37:19 +04:00
|
|
|
export GOPATH=${PWD}/gopath
|
2014-03-05 04:36:05 +04:00
|
|
|
|
2015-08-12 20:53:32 +03:00
|
|
|
go build -ldflags "${GLDFLAGS}" -o ${GOBIN}/${NAME} ${REPO_PATH}
|