github.com/ncodes/nomad@v0.5.7-0.20170403112158-97adf4a74fb3/scripts/build-dev.sh (about)

     1  #!/usr/bin/env bash
     2  set -e
     3  
     4  GIT_COMMIT="$(git rev-parse HEAD)"
     5  GIT_DIRTY="$(test -n "`git status --porcelain`" && echo "+CHANGES" || true)"
     6  LDFLAG="main.GitCommit=${GIT_COMMIT}${GIT_DIRTY}"
     7  
     8  TAGS="nomad_test"
     9  if [[ $(uname) == "Linux" ]]; then
    10  	if pkg-config --exists lxc; then
    11  		TAGS="$TAGS lxc"
    12  	fi
    13  fi
    14  
    15  echo "--> Installing with tags: $TAGS"
    16  go install -ldflags "-X $LDFLAG" -tags "${TAGS}"
    17  
    18  echo "--> Ensuring bin directory exists..."
    19  mkdir -p bin
    20  
    21  echo "--> Copying to bin"
    22  cp $GOPATH/bin/nomad bin/nomad