build: exclude binary from git history

This commit is contained in:
Cyrille Nofficial 2022-01-03 17:58:13 +01:00
parent 8b79fc58c0
commit d191e7baf1
5 changed files with 4 additions and 3 deletions

2
.gitignore vendored
View File

@ -282,5 +282,5 @@ local.properties
!.vscode/extensions.json
*.code-workspace
./rc-steering
./build/

View File

@ -26,11 +26,12 @@ image_build(){
printf "\n\nBuild go binary %s\n\n" "${BINARY}.${binary_suffix}"
CGO_ENABLED=0 GOOS=${GOOS} GOARCH=${GOARCH} GOARM=${GOARM} go build -mod vendor -a ${GOTAGS} -o "${BINARY}.${binary_suffix}" ./cmd/${BINARY}/
mkdir -p build
CGO_ENABLED=0 GOOS=${GOOS} GOARCH=${GOARCH} GOARM=${GOARM} go build -mod vendor -a ${GOTAGS} -o "build/${BINARY}.${binary_suffix}" ./cmd/${BINARY}/
buildah --os "$GOOS" --arch "$GOARCH" $VARIANT --name "$containerName" from gcr.io/distroless/static
buildah config --user 1234 "$containerName"
buildah copy "$containerName" "${BINARY}.${binary_suffix}" /go/bin/$BINARY
buildah copy "$containerName" "build/${BINARY}.${binary_suffix}" /go/bin/$BINARY
buildah config --entrypoint '["/go/bin/'$BINARY'"]' "${containerName}"
buildah commit --rm --manifest $IMAGE_NAME "${containerName}" "${containerName}"

Binary file not shown.

Binary file not shown.

Binary file not shown.