You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ro...@apache.org on 2018/11/30 19:19:22 UTC
[cloudstack-cloudmonkey] branch master updated (e5d4c7e -> c2f30ce)
This is an automated email from the ASF dual-hosted git repository.
rohit pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/cloudstack-cloudmonkey.git.
from e5d4c7e cli: only show autocompletion options when tab is pressed
new 30c498c config: bump internal version to 6.0.0-beta2
new c2f30ce cmk: add git sha and build timestamp from makefile
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
Makefile | 13 +++++++------
cmk.go | 9 ++++++++-
config/about.go | 2 +-
3 files changed, 16 insertions(+), 8 deletions(-)
[cloudstack-cloudmonkey] 01/02: config: bump internal version to
6.0.0-beta2
Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rohit pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cloudstack-cloudmonkey.git
commit 30c498c89eb7350213a762e1b0b247ede7428c3e
Author: Rohit Yadav <ro...@apache.org>
AuthorDate: Sat Dec 1 00:28:42 2018 +0530
config: bump internal version to 6.0.0-beta2
Signed-off-by: Rohit Yadav <ro...@apache.org>
---
config/about.go | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/config/about.go b/config/about.go
index dccf5de..40155f4 100644
--- a/config/about.go
+++ b/config/about.go
@@ -26,7 +26,7 @@ func (c *Config) Name() string {
// Version CLI
func (c *Config) Version() string {
- return "6.0.0-beta1"
+ return "6.0.0-beta2"
}
// PrintHeader prints startup message in CLI mode
[cloudstack-cloudmonkey] 02/02: cmk: add git sha and build
timestamp from makefile
Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rohit pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cloudstack-cloudmonkey.git
commit c2f30ced06cee3d9bb58d042b6767a64596b631b
Author: Rohit Yadav <ro...@apache.org>
AuthorDate: Sat Dec 1 00:48:29 2018 +0530
cmk: add git sha and build timestamp from makefile
With this change `cmk -v` will output git sha and build timestamp.
Signed-off-by: Rohit Yadav <ro...@apache.org>
---
Makefile | 13 +++++++------
cmk.go | 9 ++++++++-
2 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/Makefile b/Makefile
index 7bb027e..174c58a 100644
--- a/Makefile
+++ b/Makefile
@@ -24,6 +24,7 @@ BIN = $(CURDIR)/bin
BASE = $(CURDIR)
PKGS = $(or $(PKG),$(shell $(GO) list ./... | grep -v "^$(PACKAGE)/vendor/"))
TESTPKGS = $(shell $(GO) list -f '{{ if or .TestGoFiles .XTestGoFiles }}{{ .ImportPath }}{{ end }}' $(PKGS))
+GIT_SHA = $(shell git rev-parse --short HEAD)
GO = go
GODOC = godoc
@@ -34,10 +35,10 @@ Q = $(if $(filter 1,$V),,@)
M = $(shell printf "\033[34;1m▶\033[0m ")
.PHONY: all
-all: fmt ; $(info $(M) Building executable…) @ ## Build program binary
+all: fmt ; $(info $(M) Building executable… $(GIT_SHA)) @ ## Build program binary
$Q $(GO) build -mod=vendor \
-tags release \
- -ldflags '-s -w -X $(PACKAGE)/cmd.Version=$(VERSION) -X $(PACKAGE)/cmd.BuildDate=$(DATE)' \
+ -ldflags '-s -w -X main.GitSHA=$(GIT_SHA) -X main.BuildDate=$(DATE)' \
-o bin/$(PACKAGE) cmk.go
$(info $(M) Done!) @
@@ -50,10 +51,10 @@ debug:
dist: all
rm -fr dist
mkdir -p dist
- GOOS=linux GOARCH=amd64 $(GO) build -mod=vendor -ldflags='-s -w' -o dist/cmk.linux.amd64 cmk.go
- GOOS=linux GOARCH=arm64 $(GO) build -mod=vendor -ldflags='-s -w' -o dist/cmk.linux.arm64 cmk.go
- GOOS=windows GOARCH=amd64 $(GO) build -mod=vendor -ldflags='-s -w' -o dist/cmk.exe cmk.go
- GOOS=darwin GOARCH=amd64 $(GO) build -mod=vendor -ldflags='-s -w' -o dist/cmk.darwin.amd64 cmk.go
+ GOOS=linux GOARCH=amd64 $(GO) build -mod=vendor -ldflags='-s -w -X main.GitSHA=$(GIT_SHA) -X main.BuildDate=$(DATE)' -o dist/cmk.linux.amd64 cmk.go
+ GOOS=linux GOARCH=arm64 $(GO) build -mod=vendor -ldflags='-s -w -X main.GitSHA=$(GIT_SHA) -X main.BuildDate=$(DATE)' -o dist/cmk.linux.arm64 cmk.go
+ GOOS=windows GOARCH=amd64 $(GO) build -mod=vendor -ldflags='-s -w -X main.GitSHA=$(GIT_SHA) -X main.BuildDate=$(DATE)' -o dist/cmk.exe cmk.go
+ GOOS=darwin GOARCH=amd64 $(GO) build -mod=vendor -ldflags='-s -w -X main.GitSHA=$(GIT_SHA) -X main.BuildDate=$(DATE)' -o dist/cmk.darwin.amd64 cmk.go
# Tools
diff --git a/cmk.go b/cmk.go
index 1afc26e..fad4f49 100644
--- a/cmk.go
+++ b/cmk.go
@@ -27,6 +27,12 @@ import (
"github.com/apache/cloudstack-cloudmonkey/config"
)
+// GitSHA holds the git SHA
+var GitSHA string
+
+// BuildDate holds the build datetime
+var BuildDate string
+
func init() {
flag.Usage = func() {
cmd.PrintUsage()
@@ -38,12 +44,13 @@ func main() {
showVersion := flag.Bool("v", false, "show version")
debug := flag.Bool("d", false, "enable debug mode")
profile := flag.String("p", "", "server profile")
+
flag.Parse()
cfg := config.NewConfig()
if *showVersion {
- fmt.Println(cfg.Name(), cfg.Version())
+ fmt.Printf("%s %s (build: %s, %s)\n", cfg.Name(), cfg.Version(), GitSHA, BuildDate)
os.Exit(0)
}