Stamp the git tag or short commit into the binary (closes #10)
check / check (push) Failing after 3s
check / check (push) Failing after 3s
rtnetmon had no version. main.Version is now set at link time and logged in the first startup line. `make build` and `make dev` set it from `git describe --tags --always` unless VERSION is given. The Dockerfile takes it from the VERSION build argument when one is given, otherwise from `git describe --tags --always` of the .git the build context now carries, and fails the build if the context carries .git and no version comes out. .dockerignore follows the canonical copy: .git is sent, .git/config, which can hold a credential, is not. Model: opus-5-5
This commit was merged in pull request #11.
This commit is contained in:
1 parent
769511dec2
commit
bce8bdbb2e
6 files changed
+60
-23
No files matched your search
@@ -8,8 +8,12 @@ import (
|
||||
"git.eeqj.de/sneak/rtnetmon/internal/cli"
|
||||
)
|
||||
|
||||
// Version is the git tag or short commit, set at link time with -X by the
|
||||
// Makefile and the Dockerfile. Builds that do not set it report dev.
|
||||
var Version = "dev" //nolint:gochecknoglobals // set at link time with -X
|
||||
|
||||
func main() {
|
||||
err := cli.Execute()
|
||||
err := cli.Execute(Version)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user