Skip to content

Commit

Permalink
Add Version ldflag from Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
CDimonaco committed Jan 9, 2025
1 parent ac59bb3 commit 5c536fd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
VERSION ?= $(shell ./hack/get_version_from_git.sh)
INSTALLATIONSOURCE ?= "Community"
LDFLAGS = -X github.com/trento-project/workbench/version.Version="$(VERSION)"
LDFLAGS := $(LDFLAGS) -X github.com/trento-project/workbench/version.InstallationSource="$(INSTALLATIONSOURCE)"
LDFLAGS = -X main.Version="$(VERSION)"
ARCHS ?= amd64 arm64
DEBUG ?= 0

Expand Down
7 changes: 7 additions & 0 deletions cmd/workbench.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import (
"github.com/trento-project/workbench/pkg/operator"
)

var Version string

type cliOptions struct {
Arguments string `long:"arguments" short:"a" description:"Json arguments of an operator" required:"true"`
Verbose bool `long:"verbose" short:"v" description:"Log verbosity"`
Expand All @@ -32,6 +34,11 @@ func main() {
logger.SetLevel(logrus.DebugLevel)
}

logger.Infof(
"starting workbench CLI, version: %s",
Version,
)

operatorName := args[0]
registry := operator.StandardRegistry(operator.WithCustomLogger(logger))

Expand Down

0 comments on commit 5c536fd

Please sign in to comment.