mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-02 22:22:46 +00:00
Update version imprinting (#1462)
* Add version tag constant * Update build imprinting
This commit is contained in:
parent
dbae85283f
commit
7048532bc4
2 changed files with 11 additions and 4 deletions
12
build.sh
12
build.sh
|
@ -3,10 +3,16 @@
|
|||
# Put installed packages into ./bin
|
||||
export GOBIN=$PWD/`dirname $0`/bin
|
||||
|
||||
export BRANCH=`(git symbolic-ref --short HEAD | cut -d'/' -f 3 )|| ""`
|
||||
export BUILD=`git rev-parse --short HEAD || ""`
|
||||
if [ -d ".git" ]
|
||||
then
|
||||
export BUILD=`git rev-parse --short HEAD || ""`
|
||||
export BRANCH=`(git symbolic-ref --short HEAD | tr -d \/ ) || ""`
|
||||
[[ $BRANCH == "master" ]] && export BRANCH=""
|
||||
|
||||
export FLAGS="-X github.com/matrix-org/dendrite/internal.branch=$BRANCH -X github.com/matrix-org/dendrite/internal.build=$BUILD"
|
||||
export FLAGS="-X github.com/matrix-org/dendrite/internal.branch=$BRANCH -X github.com/matrix-org/dendrite/internal.build=$BUILD"
|
||||
else
|
||||
export FLAGS=""
|
||||
fi
|
||||
|
||||
go install -trimpath -ldflags "$FLAGS" -v $PWD/`dirname $0`/cmd/...
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue