2017-01-25 00:55:02 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -e
|
|
|
|
|
|
|
|
GIT_COMMIT="$(git rev-parse HEAD)"
|
|
|
|
GIT_DIRTY="$(test -n "`git status --porcelain`" && echo "+CHANGES" || true)"
|
|
|
|
LDFLAG="main.GitCommit=${GIT_COMMIT}${GIT_DIRTY}"
|
|
|
|
|
|
|
|
TAGS="nomad_test"
|
|
|
|
if [[ $(uname) == "Linux" ]]; then
|
|
|
|
if pkg-config --exists lxc; then
|
|
|
|
TAGS="$TAGS lxc"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "--> Installing with tags: $TAGS"
|
|
|
|
go install -ldflags "-X $LDFLAG" -tags "${TAGS}"
|
2017-03-09 01:42:28 +00:00
|
|
|
|
2017-03-18 00:23:05 +00:00
|
|
|
echo "--> Ensuring bin directory exists..."
|
|
|
|
mkdir -p bin
|
|
|
|
|
2017-03-09 01:42:28 +00:00
|
|
|
echo "--> Copying to bin"
|
|
|
|
cp $GOPATH/bin/nomad bin/nomad
|