Files
opantoantro/build.sh
T
Beyhan Ogur a408821410 first commit
2026-05-11 15:08:50 +03:00

17 lines
345 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
BINARY="${BINARY:-gateway}"
ENTRYPOINT="${ENTRYPOINT:-./main.go}"
LDFLAGS="${LDFLAGS:--w -s}"
GOOS="${GOOS:-linux}"
echo "=> Building ${BINARY} (CGO_ENABLED=0 GOOS=${GOOS})"
CGO_ENABLED=0 GOOS="${GOOS}" go build \
-ldflags="${LDFLAGS}" \
-o "${BINARY}" \
"${ENTRYPOINT}"
echo "=> Done: ${BINARY}"