mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-25 15:53:09 -06:00
Update build imprinting
This commit is contained in:
parent
e183eda629
commit
af9b45c443
12
build.sh
12
build.sh
|
|
@ -3,10 +3,16 @@
|
||||||
# Put installed packages into ./bin
|
# Put installed packages into ./bin
|
||||||
export GOBIN=$PWD/`dirname $0`/bin
|
export GOBIN=$PWD/`dirname $0`/bin
|
||||||
|
|
||||||
export BRANCH=`(git symbolic-ref --short HEAD | cut -d'/' -f 3 )|| ""`
|
if [ -d ".git" ]
|
||||||
export BUILD=`git rev-parse --short HEAD || ""`
|
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/...
|
go install -trimpath -ldflags "$FLAGS" -v $PWD/`dirname $0`/cmd/...
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue