build 435 B

123456789101112131415161718
  1. #!/bin/bash -e
  2. NAME="coreos-cloudinit"
  3. ORG_PATH="github.com/coreos"
  4. REPO_PATH="${ORG_PATH}/${NAME}"
  5. VERSION=$(git describe --dirty --tags)
  6. GLDFLAGS="-X main.version=\"${VERSION}\""
  7. if [ ! -h gopath/src/${REPO_PATH} ]; then
  8. mkdir -p gopath/src/${ORG_PATH}
  9. ln -s ../../../.. gopath/src/${REPO_PATH} || exit 255
  10. fi
  11. export GOBIN=${PWD}/bin
  12. export GOPATH=${PWD}/gopath
  13. go build -ldflags "${GLDFLAGS}" -o ${GOBIN}/${NAME} ${REPO_PATH}