Fix how branch is determined in CI
This commit is contained in:
parent
80a6cc017a
commit
b2e3eae82d
2 changed files with 9 additions and 1 deletions
8
debian/get-branch.sh
vendored
Executable file
8
debian/get-branch.sh
vendored
Executable file
|
@ -0,0 +1,8 @@
|
||||||
|
#!/bin/bash -e
|
||||||
|
if [ -z ${CI_COMMIT_REF_NAME+x} ]; then
|
||||||
|
# CI_COMMIT_REF_NAME is unset, try to derive it from git
|
||||||
|
git rev-parse --abbrev-ref HEAD
|
||||||
|
else
|
||||||
|
echo "${CI_COMMIT_REF_NAME}"
|
||||||
|
fi
|
||||||
|
|
2
debian/rules
vendored
2
debian/rules
vendored
|
@ -4,7 +4,7 @@ export DH_GOLANG_EXCLUDES := tools/
|
||||||
|
|
||||||
PKG := gitlab.com/signald/signald-go
|
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.Branch=$(shell debian/get-branch.sh)
|
||||||
GO_LDFLAGS += -X $(PKG)/cmd/signaldctl/common.Commit=$(CI_BUILD_REF)
|
GO_LDFLAGS += -X $(PKG)/cmd/signaldctl/common.Commit=$(CI_BUILD_REF)
|
||||||
|
|
||||||
override_dh_auto_install:
|
override_dh_auto_install:
|
||||||
|
|
Loading…
Reference in a new issue