2021-03-18 21:14:53 +00:00
|
|
|
#!/usr/bin/env sh
|
|
|
|
|
2021-03-19 07:54:29 +00:00
|
|
|
GOPATH=$HOME/go
|
2021-03-18 22:24:46 +00:00
|
|
|
GOPATH=$GOPATH:$(pwd)
|
|
|
|
export GOPATH
|
|
|
|
|
|
|
|
GIT_COMMIT=$(git rev-list -1 HEAD)
|
|
|
|
export GIT_COMMIT
|
2021-03-19 08:47:56 +00:00
|
|
|
CANONICAL_VERSION=$(cat ./VERSION)-$(uname)
|
2021-03-18 22:24:46 +00:00
|
|
|
export CANONICAL_VERSION
|
|
|
|
VERSION_STRING="$CANONICAL_VERSION-$GIT_COMMIT"
|
|
|
|
export VERSION_STRING
|
2021-03-18 21:14:53 +00:00
|
|
|
|
2021-03-19 08:45:56 +00:00
|
|
|
buildpath="build/$(uname)/gostations"
|
|
|
|
|
2021-03-18 21:14:53 +00:00
|
|
|
go mod vendor
|
|
|
|
go mod tidy
|
2021-03-18 22:24:46 +00:00
|
|
|
|
2021-03-19 08:45:56 +00:00
|
|
|
go build -o "$buildpath" -ldflags "-X main.version=$VERSION_STRING"
|
|
|
|
|
2024-07-11 08:18:11 +00:00
|
|
|
"$buildpath" -v
|
|
|
|
|
|
|
|
cp "$buildpath" ~/.local/bin
|