add platform spec to build path;echo version to console
This commit is contained in:
parent
44080ebac9
commit
758d317d0f
7
build.sh
7
build.sh
@ -3,7 +3,6 @@
|
|||||||
GOPATH=$HOME/go
|
GOPATH=$HOME/go
|
||||||
GOPATH=$GOPATH:$(pwd)
|
GOPATH=$GOPATH:$(pwd)
|
||||||
export GOPATH
|
export GOPATH
|
||||||
echo $GOPATH
|
|
||||||
|
|
||||||
GIT_COMMIT=$(git rev-list -1 HEAD)
|
GIT_COMMIT=$(git rev-list -1 HEAD)
|
||||||
export GIT_COMMIT
|
export GIT_COMMIT
|
||||||
@ -12,7 +11,11 @@ export CANONICAL_VERSION
|
|||||||
VERSION_STRING="$CANONICAL_VERSION-$GIT_COMMIT"
|
VERSION_STRING="$CANONICAL_VERSION-$GIT_COMMIT"
|
||||||
export VERSION_STRING
|
export VERSION_STRING
|
||||||
|
|
||||||
|
buildpath="build/$(uname)/gostations"
|
||||||
|
|
||||||
go mod vendor
|
go mod vendor
|
||||||
go mod tidy
|
go mod tidy
|
||||||
|
|
||||||
go build -o build/gostations -ldflags "-X main.version=$VERSION_STRING"
|
go build -o "$buildpath" -ldflags "-X main.version=$VERSION_STRING"
|
||||||
|
|
||||||
|
"$buildpath" -v
|
Loading…
Reference in New Issue
Block a user