Skip to content

Commit

Permalink
Align version metadata to GoReleaser format
Browse files Browse the repository at this point in the history
  • Loading branch information
dtan4 committed Mar 13, 2020
1 parent 17fe56f commit 59707bc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
11 changes: 6 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
NAME := k8stail
VERSION := v0.6.0
REVISION := $(shell git rev-parse --short HEAD)
NAME := k8stail
VERSION := $(shell git tag | sort -V -r | head -n1)-next
COMMIT := $(shell git rev-parse HEAD)
DATE := $(shell date "+%Y-%m-%dT%H:%M:%S%z")

SRCS := $(shell find . -name '*.go' -type f)
LDFLAGS := -ldflags="-s -w -X \"main.Version=$(VERSION)\" -X \"main.Revision=$(REVISION)\""
SRCS := $(shell find . -name '*.go' -type f)
LDFLAGS := -ldflags="-s -w -X \"main.version=$(VERSION)\" -X \"main.commit=$(COMMIT)\" -X \"main.date=$(DATE)\""

.DEFAULT_GOAL := bin/$(NAME)

Expand Down
7 changes: 4 additions & 3 deletions version.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ import (
)

var (
Version string
Revision string
version string
commit string
date string
)

func printVersion() {
fmt.Printf("k8stail version %s, %s\n", Version, Revision)
fmt.Printf("k8stail version: %s, commit: %s, build at: %s\n", version, commit, date)
}

0 comments on commit 59707bc

Please sign in to comment.