Add release version for the Helm CLI

Fixes https://github.com/kubernetes/helm/issues/761
pull/775/head
Aaron Schlesinger 9 years ago
parent 9615838656
commit c8e2b0d875

@ -2,13 +2,15 @@ DOCKER_REGISTRY ?= gcr.io
IMAGE_PREFIX ?= kubernetes-helm IMAGE_PREFIX ?= kubernetes-helm
SHORT_NAME ?= tiller SHORT_NAME ?= tiller
CLI_VERSION ?= devel
# go option # go option
GO ?= go GO ?= go
PKG := $(shell glide novendor) PKG := $(shell glide novendor)
TAGS := TAGS :=
TESTS := . TESTS := .
TESTFLAGS := TESTFLAGS :=
LDFLAGS := LDFLAGS := "-X cmd.helm.cliVersion ${CLI_VERSION}"
GOFLAGS := GOFLAGS :=
BINDIR := $(CURDIR)/bin BINDIR := $(CURDIR)/bin
BINARIES := helm tiller BINARIES := helm tiller

@ -0,0 +1,37 @@
package main
import (
"errors"
"fmt"
"strings"
"github.com/gosuri/uitable"
"github.com/kubernetes/helm/pkg/helm"
"github.com/kubernetes/helm/pkg/proto/hapi/release"
"github.com/kubernetes/helm/pkg/proto/hapi/services"
"github.com/kubernetes/helm/pkg/timeconv"
"github.com/spf13/cobra"
)
var (
versionHelp = "This command prints out the current version of the Helm CLI."
// this variable is set by the Makefile, using the Go linker flags
cliVersion = "devel"
)
var versionCommand = &cobra.Command{
Use: "version",
Short: "Get the current version of Helm",
Long: versionHelp,
RunE: versionCmd,
Aliases: []string{"vsn"},
}
func init() {
RootCommand.AddCommand(versionCommand)
}
func versionCmd(cmd *cobra.Command, args []string) error {
fmt.Println("Helm CLI version", cliVersion)
return nil
}
Loading…
Cancel
Save