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:
parent
1a3275b70d
commit
9dc352029a
2
.github/workflows/verify-go.yml
vendored
2
.github/workflows/verify-go.yml
vendored
@ -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}}
|
||||
|
@ -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
|
||||
|
@ -1,3 +1,5 @@
|
||||
// +build !release
|
||||
|
||||
package mock
|
||||
|
||||
import (
|
||||
|
Loading…
Reference in New Issue
Block a user