From 8b7269ae098d6f9d0ecdc9c6935c4617cfa8be08 Mon Sep 17 00:00:00 2001 From: Finn Date: Wed, 3 Feb 2021 02:30:14 -0800 Subject: [PATCH] more version detection --- .gitlab-ci.yml | 3 +-- debian/rules | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6f2d0eb..9202c65 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -24,7 +24,6 @@ lint: - cp -r * /go/src/gitlab.com/signald/signald-go script: - git checkout "${CI_COMMIT_BRANCH}" - - git pull --tags - VERSION="$(git describe --abbrev=0 HEAD)-$(git rev-list $(git describe --abbrev=0 HEAD)..HEAD --count)-$(git rev-parse --short=8 HEAD)" - echo "building ${VERSION}" - cd /go/src/gitlab.com/signald/signald-go @@ -49,7 +48,6 @@ build:cross-compile: - cp -r * /go/src/gitlab.com/signald/signald-go script: - git checkout "${CI_COMMIT_BRANCH}" - - git pull --tags - VERSION="$(git describe --abbrev=0 HEAD)-$(git rev-list $(git describe --abbrev=0 HEAD)..HEAD --count)-$(git rev-parse --short=8 HEAD)" - echo "building ${VERSION}" - cd /go/src/gitlab.com/signald/signald-go @@ -76,6 +74,7 @@ build:x86:deb: - apt-get install -y git-buildpackage dh-golang bash-completion golang-any golang-github-spf13-cobra-dev golang-github-spf13-viper-dev - apt-get install -y ./*.deb && rm -vf *.deb script: + - git checkout "${CI_COMMIT_BRANCH}" - go run ./cmd/signaldctl doc -o man - go run ./cmd/signaldctl completion bash > debian/package.bash-completion - ls *.1 > debian/manpages diff --git a/debian/rules b/debian/rules index 47a79a9..6a9db60 100755 --- a/debian/rules +++ b/debian/rules @@ -3,7 +3,7 @@ export DH_GOLANG_EXCLUDES := tools/ PKG := gitlab.com/signald/signald-go -# GO_LDFLAGS += -X $(PKG)/cmd/signaldctl/common.Version=$(DEB_VERSION) +GO_LDFLAGS += -X $(PKG)/cmd/signaldctl/common.Version=$(DEB_VERSION) GO_LDFLAGS += -X $(PKG)/cmd/signaldctl/common.Branch=$(shell git rev-parse HEAD) GO_LDFLAGS += -X $(PKG)/cmd/signaldctl/common.Commit=$(CI_BUILD_REF)