From d777dd44095968d871631f7057e5026d03b0f7f9 Mon Sep 17 00:00:00 2001 From: Emanuel Bennici Date: Tue, 15 Oct 2019 18:13:26 +0200 Subject: [PATCH 1/4] Change App Data Variables to goreleaser-Defaults --- cmd/kubenab/main.go | 2 +- cmd/kubenab/version.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/kubenab/main.go b/cmd/kubenab/main.go index 584bd67..bd25a01 100644 --- a/cmd/kubenab/main.go +++ b/cmd/kubenab/main.go @@ -17,7 +17,7 @@ var ( func main() { // print Version Informations - log.Printf("Starting kubenab version %s - %s - %s", AppVersion, BuildDate, GitHash) + log.Printf("Starting kubenab version %s - %s - %s", version, date, commit) // check if all required Flags are set and in a correct Format checkArguments() diff --git a/cmd/kubenab/version.go b/cmd/kubenab/version.go index 6f481aa..b5a607a 100644 --- a/cmd/kubenab/version.go +++ b/cmd/kubenab/version.go @@ -3,7 +3,7 @@ package main // This File contains only the Version Informations about `kubenab` var ( - AppVersion = "** NOT SET **" // Contains a SemVer Version - BuildDate = "** NOT SET **" // Contains the UTC Build Time - GitHash = "** NOT SET **" // Contains the SHA1 Hash of the last Commit + version = "** NOT SET **" // Contains a SemVer Version + date = "** NOT SET **" // Contains the UTC Build Time + commit = "** NOT SET **" // Contains the SHA1 Hash of the last Commit ) From 6c1007789d120a70e65d78888e3fbea3c1d1443f Mon Sep 17 00:00:00 2001 From: Emanuel Bennici Date: Tue, 15 Oct 2019 18:18:02 +0200 Subject: [PATCH 2/4] Update deprecated `archive` Declaration `archive` is deprecated[1] since 2019-04-16 so switch to `archives`i and add the `README.md` to the Archive. [1]: https://goreleaser.com/deprecations#archive --- .goreleaser.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 186e18a..cbcdd68 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -12,9 +12,11 @@ builds: - windows goarch: - amd64 -archive: - format: tar.gz - files: - - LICENSE +archives: + - format: tar.gz + name_template: "kubenab_{{ .Version }}_{{ .Os }}_{{ .Arch }}" + files: + - LICENSE + - README.md checksum: name_template: 'checksums.txt' From 081a41bf8641a2b566ee1a8aa12fdcb32d3a69c7 Mon Sep 17 00:00:00 2001 From: Emanuel Bennici Date: Tue, 15 Oct 2019 18:19:43 +0200 Subject: [PATCH 3/4] Add 'strip_debug' Flag to goreleaser goreleaser now compiles (default) with the `strip_debug` Flag set, so every debug Log Entry will be stripped. --- .goreleaser.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.goreleaser.yml b/.goreleaser.yml index cbcdd68..ceaec6c 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -12,6 +12,8 @@ builds: - windows goarch: - amd64 + flags: + - -tags 'strip_debug' archives: - format: tar.gz name_template: "kubenab_{{ .Version }}_{{ .Os }}_{{ .Arch }}" From 7cadfe5ce0fea80c1b46302b364afe253944451b Mon Sep 17 00:00:00 2001 From: Emanuel Bennici Date: Tue, 15 Oct 2019 18:20:36 +0200 Subject: [PATCH 4/4] Change App Version Info Variable Names in Makefile Since we have changed the App Info Variables in Commit d777dd44095968d871631f7057e5026d03b0f7f9 we have to change them also in the Makefile under the `ldflags` or it would break the Makefile. This is the last Patch which implements the Enhancement of jfrog#30 Why changing the App Info Variable Names? Because goreleaser use those Names as from default so we have not to edit more Fields of the `.goreleaser.yaml` Config. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 1904210..5d9665d 100644 --- a/Makefile +++ b/Makefile @@ -22,4 +22,4 @@ build: git fetch --tags @echo "++ Building kubenab go binary..." mkdir -p bin - cd cmd/kubenab && go build $(STRIP_DEBUG) -a --installsuffix cgo --ldflags="-s -X main.AppVersion=$(APP_VERSION) -X main.BuildDate=$(BUILD_DATE) -X main.GitHash=$(GIT_HASH)" -o $(OUT_DIR)/kubenab + cd cmd/kubenab && go build $(STRIP_DEBUG) -a --installsuffix cgo --ldflags="-s -X main.version=$(APP_VERSION) -X main.date=$(BUILD_DATE) -X main.commit=$(GIT_HASH)" -o $(OUT_DIR)/kubenab