Fix getting commit SHA in CI

This commit is contained in:
Tulir Asokan 2020-06-03 20:49:26 +03:00
parent 0f7163a294
commit 4b23ca9ff2

View file

@ -14,7 +14,7 @@ stages:
- apk add build-base olm-dev@edge_community
- mkdir -p .cache
- export GOPATH="$CI_PROJECT_DIR/.cache"
- export GO_LDFLAGS="-X main.Tag=$CI_COMMIT_TAG -X main.Commit=$CI_COMMIT_REF_NAME -X 'main.BuildTime=`date '+%b %_d %Y, %H:%M:%S'`'"
- export GO_LDFLAGS="-X main.Tag=$CI_COMMIT_TAG -X main.Commit=$CI_COMMIT_SHA -X 'main.BuildTime=`date '+%b %_d %Y, %H:%M:%S'`'"
script:
- go build -ldflags "$GO_LDFLAGS" -o mautrix-whatsapp
artifacts:
@ -44,7 +44,7 @@ build static:
before_script:
- mkdir -p .cache
- export GOPATH="$CI_PROJECT_DIR/.cache"
- export GO_LDFLAGS="-X main.Tag=$CI_COMMIT_TAG -X main.Commit=$CI_COMMIT_REF_NAME -X 'main.BuildTime=`date '+%b %_d %Y, %H:%M:%S'`'"
- export GO_LDFLAGS="-X main.Tag=$CI_COMMIT_TAG -X main.Commit=$CI_COMMIT_SHA -X 'main.BuildTime=`date '+%b %_d %Y, %H:%M:%S'`'"
variables:
CGO_ENABLED: 0
script: