From 5c855f85fd2099056ff6b49c4ebeb9b87de066b2 Mon Sep 17 00:00:00 2001 From: Jean-Marc MEESSEN Date: Mon, 13 Jul 2020 13:59:40 +0200 Subject: [PATCH] Improve versionning automation --- build.sh | 10 ++++++++++ cmd/FLEcli_version.go | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index f05a7df..5c263a0 100755 --- a/build.sh +++ b/build.sh @@ -2,5 +2,15 @@ set -e +VERSION_FROM_GIT=$(git describe --tags) +BUILD_TIME=$(date +%F) +echo "$VERSION_FROM_GIT" +echo "$BUILD_TIME" + +echo "package cmd" > cmd/FLEcli_version.go +echo " " >> cmd/FLEcli_version.go +echo "//VersionString is the version that will be displayed with the -v switch" >> cmd/FLEcli_version.go +echo "const VersionString = \"${VERSION_FROM_GIT} (${BUILD_TIME})\"" >> cmd/FLEcli_version.go + go build go test ./... \ No newline at end of file diff --git a/cmd/FLEcli_version.go b/cmd/FLEcli_version.go index c12177d..29e9438 100644 --- a/cmd/FLEcli_version.go +++ b/cmd/FLEcli_version.go @@ -1,4 +1,4 @@ package cmd //VersionString is the version that will be displayed with the -v switch -const VersionString = "v0.0.0 2020-07-11" +const VersionString = "v0.0.0.0-1-gb264805 (2020-07-13)"