github.com/azunymous/cdx@v0.0.0-20201122180449-fbb46cc4d252/hack/build.sh (about)

     1  #!/usr/bin/env bash
     2  set -euo pipefail
     3  SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
     4  PROJECT_DIR="${SCRIPT_DIR}/../"
     5  
     6  COMMAND=${1:-build}
     7  
     8  go ${COMMAND} -ldflags \
     9    "-X main.version=`cdx tag latest -n cdx --head --fallback` -X main.buildTime=`date -u '+%Y-%m-%d_%I:%M:%S%p'` -X main.gitHash=`git rev-parse HEAD`" \
    10    ./cmd/cdx/