1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-11-24 08:32:32 +02:00

Add tag release when building go binary

This commit is contained in:
Florian Geckeler 2020-02-27 15:01:38 +01:00 committed by GitHub
parent 1a3275b70d
commit 9dc352029a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 1 deletions

View File

@ -64,7 +64,7 @@ jobs:
- name: checkout
uses: actions/checkout@v2
- name: build
run: CGO_ENABLED=0 go build -o piper && chmod +x piper
run: CGO_ENABLED=0 go build -o piper -tags release && chmod +x piper # with `-tags release` we ensure that shared test utilities won't end up in the binary
- name: test
env:
PIPER_INTEGRATION_GITHUB_TOKEN: ${{secrets.PIPER_INTEGRATION_GITHUB_TOKEN}}

View File

@ -7,6 +7,7 @@ RUN go test ./... -cover
## ONLY tests so far, building to be added later
# execute build
# with `-tags release` we ensure that shared test utilities won't end up in the binary
RUN export GIT_COMMIT=$(git rev-parse HEAD) && \
export GIT_REPOSITORY=$(git config --get remote.origin.url) && \
CGO_ENABLED=0 go build \
@ -14,6 +15,7 @@ RUN export GIT_COMMIT=$(git rev-parse HEAD) && \
"-X github.com/SAP/jenkins-library/cmd.GitCommit=${GIT_COMMIT} \
-X github.com/SAP/jenkins-library/pkg/log.LibraryRepository=${GIT_REPOSITORY} \
-X github.com/SAP/jenkins-library/pkg/telemetry.LibraryRepository=${GIT_REPOSITORY}" \
-tags release \
-o piper
# FROM gcr.io/distroless/base:latest

View File

@ -1,3 +1,5 @@
// +build !release
package mock
import (