Skip to content

Commit

Permalink
Add versioning
Browse files Browse the repository at this point in the history
Add version to helpmessage
Version is set during make from makefile variable
Set version to 1.1
  • Loading branch information
sharmay authored May 13, 2022
1 parent 9850e56 commit cf1b1e8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ import (
//"flag"
)

var Version = "development"

type config struct {
remoteTimeout time.Duration
listenAddr string
Expand Down Expand Up @@ -186,7 +188,7 @@ func main() {
}

func parseFlags() *config {
a := kingpin.New(filepath.Base(os.Args[0]), "Remote storage adapter [ PostgreSQL ]")
a := kingpin.New(filepath.Base(os.Args[0]), fmt.Sprintf("Remote storage adapter [ PostgreSQL ], Version: %s", Version))
a.HelpFlag.Short('h')

cfg := &config{
Expand Down
4 changes: 2 additions & 2 deletions makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION=1.0-RC1
VERSION=1.1
ORGANIZATION=crunchydata

SOURCES:=$(shell find . -name '*.go' | grep -v './vendor')
Expand All @@ -12,7 +12,7 @@ all: $(TARGET)
build: $(TARGET)

$(TARGET): main.go $(SOURCES)
go build -o $(TARGET)
go build -ldflags="-X 'main.Version=${VERSION}'" -o $(TARGET)

container: $(TARGET) Dockerfile
@#podman rmi $(ORGANIZATION)/$(TARGET):latest $(ORGANIZATION)/$(TARGET):$(VERSION)
Expand Down

0 comments on commit cf1b1e8

Please sign in to comment.