ooni-probe-cli/CLI/go-build-alpine

17 lines
450 B
Plaintext
Raw Normal View History

#!/bin/sh
set -euxo pipefail
# Some of the following exports are redundant but are however
# useful because they provide explicit logging
export CGO_ENABLED=1
export GOARM=$GOARM
export GOCACHE=$GOCACHE
export GOMODCACHE=$GOMODCACHE
export GOOS=$GOOS
export GOARCH=$GOARCH
for PACKAGE in $@; do
PRODUCT=$(basename $PACKAGE)
go build -o ./CLI/$PRODUCT-$GOOS-$OONIARCH \
-ldflags='-s -w -extldflags "-static"' \
$GOLANG_EXTRA_FLAGS $PACKAGE
done