Skip to content

Commit

Permalink
set ldflags in build
Browse files Browse the repository at this point in the history
  • Loading branch information
meiji163 committed Dec 20, 2024
1 parent d5ab048 commit 6f40e07
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions script/build
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ scriptdir="$PWD"/script

# We have a few binaries that we want to build, so let's put them into bin/

version=$(git rev-parse HEAD)
describe=$(git describe --tags --always --dirty)
RELEASE_VERSION=$(git describe --abbrev=0 --tags | tr -d 'v')
GIT_COMMIT=$(git rev-parse HEAD)

export GOPATH="$PWD/.gopath"
cd .gopath/src/github.com/github/gh-ost

# We put the binaries directly into the bindir, because we have no need for shim wrappers
go build -o "$bindir/gh-ost" -ldflags "-X main.AppVersion=${version} -X main.BuildDescribe=${describe}" ./go/cmd/gh-ost/main.go
go build -o "$bindir/gh-ost" -ldflags "-X main.AppVersion=${RELEASE_VERSION} -X main.GitCommit=${GIT_COMMIT}" ./go/cmd/gh-ost/main.go

0 comments on commit 6f40e07

Please sign in to comment.