| 1 | #!/usr/bin/envscip-shell filesystem . . `/usr/bin/env`. bash |
| 2 | |
| 3 | set -eu |
| 4 | |
| 5 | NAME="ignition" |
| 6 | ORG_PATH="github.com/coreos" |
| 7 | REPO_PATH="${ORG_PATH}/${NAME}/v2" |
| 8 | GLDFLAGS=${GLDFLAGS:-} |
| 9 | |
| 10 | if [scip-shell system . . `[`. -z ${VERSION+a} ]; then |
| 11 | echoscip-shell system . . echo. "Using version from git..." |
| 12 | VERSION=$(gitscip-shell system . . git. describe --dirty --always) |
| 13 | fi |
| 14 | |
| 15 | GLDFLAGS+="-X github.com/coreos/ignition/v2/internal/version.Raw=${VERSION}" |
| 16 | |
| 17 | if [[ -n "$(git status -s)" ]]; then |
| 18 | echoscip-shell system . . echo. "git repo not clean" |
| 19 | exit 1 |
| 20 | fi |
| 21 | |
| 22 | if [scip-shell system . . `[`. -z ${BIN_PATH+a} ]; then |
| 23 | export BIN_PATH=${PWD}/bin/container/ |
| 24 | fi |
| 25 | |
| 26 | export GO11MODULE=on |
| 27 | export CGO_ENABLED=0 |
| 28 | export GOFLAGS='-mod=vendor' |
| 29 | export GOOS=linux |
| 30 | |
| 31 | goscip-shell system . . go. build -ldflags "${GLDFLAGS}" -o ${BIN_PATH}/ignition-validate ${REPO_PATH}/validate |