Debian Codegraph @

build_for_container

raw symbols SCIP
1 #!/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 [ -z ${VERSION+a} ]; then
11 echo "Using version from git..."
12 VERSION=$(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 echo "git repo not clean"
19 exit 1
20 fi
21
22 if [ -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 go build -ldflags "${GLDFLAGS}" -o ${BIN_PATH}/ignition-validate ${REPO_PATH}/validate