Skip to content
This repository has been archived by the owner on Mar 29, 2024. It is now read-only.

Commit

Permalink
Build hub without cgo
Browse files Browse the repository at this point in the history
  • Loading branch information
dhaavi committed Sep 22, 2022
1 parent 55e70d3 commit 2a6d2c3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions cmds/hub/build
Expand Up @@ -43,16 +43,18 @@ if [[ "$BUILD_SOURCE" == "" ]]; then
exit 1
fi

echo "Please notice, that this build script includes metadata into the build."
echo "This information is useful for debugging and license compliance."
echo "Run the compiled binary with the -version flag to see the information included."

# set build options
export CGO_ENABLED=0
if [[ $1 == "dev" ]]; then
shift
export CGO_ENABLED=1
DEV="-race"
fi

echo "Please notice, that this build script includes metadata into the build."
echo "This information is useful for debugging and license compliance."
echo "Run the compiled binary with the -version flag to see the information included."

# build
BUILD_PATH="github.com/safing/portbase/info"
go build $DEV -ldflags "-X ${BUILD_PATH}.commit=${BUILD_COMMIT} -X ${BUILD_PATH}.buildOptions=${BUILD_BUILDOPTIONS} -X ${BUILD_PATH}.buildUser=${BUILD_USER} -X ${BUILD_PATH}.buildHost=${BUILD_HOST} -X ${BUILD_PATH}.buildDate=${BUILD_DATE} -X ${BUILD_PATH}.buildSource=${BUILD_SOURCE}" $*

0 comments on commit 2a6d2c3

Please sign in to comment.