Reduce the size of the binaries
This commit is contained in:
parent
3213b3c6de
commit
f44706c661
|
@ -35,12 +35,18 @@ if ! which gox > /dev/null; then
|
|||
go get -u github.com/mitchellh/gox
|
||||
fi
|
||||
|
||||
LD_FLAGS="-X main.GitCommit=${GIT_COMMIT}${GIT_DIRTY}"
|
||||
# In relase mode we don't want debug information in the binary
|
||||
if [[ -n "${TF_RELEASE}" ]]; then
|
||||
LD_FLAGS="-X main.GitCommit=${GIT_COMMIT}${GIT_DIRTY} -s -w"
|
||||
fi
|
||||
|
||||
# Build!
|
||||
echo "==> Building..."
|
||||
gox \
|
||||
-os="${XC_OS}" \
|
||||
-arch="${XC_ARCH}" \
|
||||
-ldflags "-X main.GitCommit=${GIT_COMMIT}${GIT_DIRTY}" \
|
||||
-ldflags "${LD_FLAGS}" \
|
||||
-output "pkg/{{.OS}}_{{.Arch}}/terraform-{{.Dir}}" \
|
||||
$(go list ./... | grep -v /vendor/)
|
||||
|
||||
|
|
Loading…
Reference in New Issue