main: Add a --version flag to show the build version
This embeds the version at build time and displays it when passed the --version flag.
This commit is contained in:
parent
63bb56e12d
commit
2cfe043f5e
3 changed files with 6 additions and 3 deletions
|
|
@ -85,6 +85,7 @@ export GOFLAGS+=" -mod=vendor"
|
|||
GOTAGS="exclude_graphdriver_btrfs"
|
||||
%endif
|
||||
|
||||
export LDFLAGS="${LDFLAGS} -X 'main.BuildVersion=%{version}'"
|
||||
%gobuild ${GOTAGS:+-tags=$GOTAGS} -o %{gobuilddir}/bin/image-builder %{goipath}/cmd/image-builder
|
||||
|
||||
%install
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue