From 4b23ca9ff2a79fa3b874ca4c545ebe709f1a4f76 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Wed, 3 Jun 2020 20:49:26 +0300 Subject: [PATCH] Fix getting commit SHA in CI --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index edea4cc..ab24f72 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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: