cloudinit/build

18 lines
435 B
Plaintext
Raw Normal View History

2014-03-04 16:36:05 -08:00
#!/bin/bash -e
NAME="coreos-cloudinit"
2014-05-10 01:42:57 -07:00
ORG_PATH="github.com/coreos"
REPO_PATH="${ORG_PATH}/${NAME}"
VERSION=$(git describe --dirty --tags)
GLDFLAGS="-X main.version \"${VERSION}\""
2014-05-10 01:42:57 -07: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-04 16:36:05 -08:00
export GOBIN=${PWD}/bin
export GOPATH=${PWD}/gopath
2014-03-04 16:36:05 -08:00
go build -ldflags "${GLDFLAGS}" -o ${GOBIN}/${NAME} ${REPO_PATH}