Closed rawdaGastan closed 10 months ago
The server should be build as follows in order to get the latest version and commit of the app:
go build -ldflags "-X 'github.com/codescalersinternships/Flyspray/cmd.commit=$(shell git rev-parse --short HEAD)' -X 'github.com/codescalersinternships/Flyspray/cmd.version=$(shell git describe --abbrev=0 --tags)'"
Where,
git rev-parse --short HEAD
: This command retrieves the short hash of the latest commit in the repo. It assigns the value to github.com/codescalersinternships/Flyspray/cmd.commit
variable.git describe --abbrev=0 --tags
: This command retrieves the latest annotated tag in the repo It assigns the value to github.com/codescalersinternships/Flyspray/cmd.version
variable.
Add a get version command for backend