mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-29 01:33:10 -06:00
Revert build script changes
This commit is contained in:
parent
571777ede8
commit
4d6b8ab5f2
15
build.sh
15
build.sh
|
|
@ -2,7 +2,22 @@
|
||||||
|
|
||||||
# Put installed packages into ./bin
|
# Put installed packages into ./bin
|
||||||
export GOBIN=$PWD/`dirname $0`/bin
|
export GOBIN=$PWD/`dirname $0`/bin
|
||||||
|
|
||||||
|
if [ -d ".git" ]
|
||||||
|
then
|
||||||
|
export BUILD=`git rev-parse --short HEAD || ""`
|
||||||
|
export BRANCH=`(git symbolic-ref --short HEAD | tr -d \/ ) || ""`
|
||||||
|
if [ "$BRANCH" = master ]
|
||||||
|
then
|
||||||
|
export BRANCH=""
|
||||||
|
fi
|
||||||
|
|
||||||
|
export FLAGS="-X github.com/matrix-org/dendrite/internal.branch=$BRANCH -X github.com/matrix-org/dendrite/internal.build=$BUILD"
|
||||||
|
else
|
||||||
export FLAGS=""
|
export FLAGS=""
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir -p bin
|
||||||
|
|
||||||
CGO_ENABLED=1 go build -trimpath -ldflags "$FLAGS" -v -o "bin/" ./cmd/...
|
CGO_ENABLED=1 go build -trimpath -ldflags "$FLAGS" -v -o "bin/" ./cmd/...
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue