Skip to content

Instantly share code, notes, and snippets.

@jayunit100
Created December 15, 2022 18:05
Show Gist options
  • Save jayunit100/7341c01291fc75fca43bd3d6a7a24313 to your computer and use it in GitHub Desktop.
Save jayunit100/7341c01291fc75fca43bd3d6a7a24313 to your computer and use it in GitHub Desktop.
sonobuoy build script (fails) for debugging
harborBase="harbor-repo.vmware.com/dockerhub-proxy-cache/library"
########### build sonobuoy binaries ########
BINARY=sonobuoy
VERBOSE_FLAG=-v
GIT_VERSION="${releaseVersion}"
GIT_REF_LONG=$(git rev-parse --verify HEAD)
golangVersion=1.19.4
# linux
docker run --rm -v "${PWD}:/go/src/github.com/vmware-tanzu/sonobuoy" -w "/go/src/github.com/vmware-tanzu/sonobuoy" \
--env CGO_ENABLED=0 \
--env GO111MODULE=on \
--env GOOS=${GOOS:-linux} \
--env GOARCH=${GOARCH:-amd64} \
${harborBase}/golang:${golangVersion} \
go build -o "${BINARY}-linux" ${VERBOSE_FLAG} -ldflags="-s -w -X github.com/vmware-tanzu/sonobuoy/pkg/buildinfo.Version=${GIT_VERSION} -X github.com/vmware-tanzu/sonobuoy/pkg/buildinfo.GitSHA=${GIT_REF_LONG}" github.com/vmware-tanzu/sonobuoy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment