1a86aecf55
This PR adds a version package and consolidates version strings into a Version struct.
23 lines
539 B
Bash
Executable file
23 lines
539 B
Bash
Executable file
#!/usr/bin/env bash
|
|
set -e
|
|
|
|
GIT_COMMIT="$(git rev-parse HEAD)"
|
|
GIT_DIRTY="$(test -n "`git status --porcelain`" && echo "+CHANGES" || true)"
|
|
LDFLAG="github.com/hashicorp/nomad/version.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}"
|
|
|
|
echo "--> Ensuring bin directory exists..."
|
|
mkdir -p bin
|
|
|
|
echo "--> Copying to bin"
|
|
cp $GOPATH/bin/nomad bin/nomad
|