Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
helm3
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
helm3
Commits
264c6b10
Commit
264c6b10
authored
Sep 15, 2016
by
Adam Reese
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(*): add git tree state to binaries
* clean up version output
parent
1d6202d8
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
24 deletions
+28
-24
version.go
cmd/helm/version.go
+2
-2
release_server.go
cmd/tiller/release_server.go
+1
-1
client.go
pkg/helm/client.go
+1
-1
version.go
pkg/version/version.go
+21
-19
versioning.mk
versioning.mk
+3
-1
No files found.
cmd/helm/version.go
View file @
264c6b10
...
...
@@ -52,12 +52,12 @@ func (v *versionCmd) run() error {
// Regardless of whether we can talk to server or not, just print the client
// version.
cv
:=
version
.
GetVersionProto
()
fmt
.
Fprintf
(
v
.
out
,
"Client:
{SemVer: %s GitCommit: %s}
\n
"
,
cv
.
SemVer
,
cv
.
GitCommit
)
fmt
.
Fprintf
(
v
.
out
,
"Client:
%#v
\n
"
,
cv
)
resp
,
err
:=
v
.
client
.
GetVersion
()
if
err
!=
nil
{
return
err
}
fmt
.
Fprintf
(
v
.
out
,
"Server:
{SemVer: %s GitCommit: %s}
\n
"
,
resp
.
Version
.
SemVer
,
resp
.
Version
.
GitCommit
)
fmt
.
Fprintf
(
v
.
out
,
"Server:
%#v
\n
"
,
resp
.
Version
)
return
nil
}
cmd/tiller/release_server.go
View file @
264c6b10
...
...
@@ -178,7 +178,7 @@ func filterReleases(filter string, rels []*release.Release) ([]*release.Release,
func
(
s
*
releaseServer
)
GetVersion
(
c
ctx
.
Context
,
req
*
services
.
GetVersionRequest
)
(
*
services
.
GetVersionResponse
,
error
)
{
v
:=
version
.
GetVersionProto
()
return
&
services
.
GetVersionResponse
{
Version
:
&
v
},
nil
return
&
services
.
GetVersionResponse
{
Version
:
v
},
nil
}
func
(
s
*
releaseServer
)
GetReleaseStatus
(
c
ctx
.
Context
,
req
*
services
.
GetReleaseStatusRequest
)
(
*
services
.
GetReleaseStatusResponse
,
error
)
{
...
...
pkg/helm/client.go
View file @
264c6b10
...
...
@@ -120,7 +120,7 @@ func (h *Client) UpdateRelease(rlsName string, chStr string, opts ...UpdateOptio
return
h
.
opts
.
rpcUpdateRelease
(
rlsName
,
chart
,
rls
.
NewReleaseServiceClient
(
c
),
opts
...
)
}
// Version returns the server version
//
Get
Version returns the server version
//
// Note: there aren't currently any supported StatusOptions,
// but they are kept in the API signature as a placeholder for future additions.
...
...
pkg/version/version.go
View file @
264c6b10
...
...
@@ -17,26 +17,27 @@ limitations under the License.
// Package version represents the current version of the project.
package
version
// import "k8s.io/helm/pkg/version"
import
(
"k8s.io/helm/pkg/proto/hapi/version"
import
"k8s.io/helm/pkg/proto/hapi/version"
var
(
// Version is the current version of the Helm.
// Update this whenever making a new release.
// The version is of the format Major.Minor.Patch[-Prerelease][+BuildMetadata]
//
// Increment major number for new feature additions and behavioral changes.
// Increment minor number for bug fixes and performance enhancements.
// Increment patch number for critical fixes to existing releases.
Version
=
"v2.0.0-alpha.4"
// BuildMetadata is extra build time data
BuildMetadata
=
""
// GitCommit is the git sha1
GitCommit
=
""
// GitTreeState is the state of the git tree
GitTreeState
=
""
)
// Version is the current version of the Helm.
// Update this whenever making a new release.
// The version is of the format Major.Minor.Patch[-Prerelease][+BuildMetadata]
//
// Increment major number for new feature additions and behavioral changes.
// Increment minor number for bug fixes and performance enhancements.
// Increment patch number for critical fixes to existing releases.
//
// BuildMetadata gets filled in during build, do not touch
// GitCommit gets filled in during build, do not touch
var
Version
=
"v2.0.0-alpha.4"
var
BuildMetadata
=
""
var
GitCommit
=
""
// GetVersion returns the semver string of the version
func
GetVersion
()
string
{
if
BuildMetadata
==
""
{
return
Version
...
...
@@ -45,9 +46,10 @@ func GetVersion() string {
}
// GetVersionProto returns protobuf representing the version
func
GetVersionProto
()
version
.
Version
{
return
version
.
Version
{
func
GetVersionProto
()
*
version
.
Version
{
return
&
version
.
Version
{
SemVer
:
GetVersion
(),
GitCommit
:
GitCommit
,
GitTreeState
:
GitTreeState
,
}
}
versioning.mk
View file @
264c6b10
...
...
@@ -3,6 +3,7 @@ MUTABLE_VERSION ?= canary
GIT_COMMIT := $(shell git rev-parse HEAD)
GIT_SHA := $(shell git rev-parse --short HEAD)
GIT_TAG := $(shell git describe --tags --abbrev=0 2>/dev/null)
GIT_DIRTY = $(shell test -n "`git status --porcelain`" && echo "dirty" || echo "clean")
ifdef VERSION
DOCKER_VERSION = $(VERSION)
...
...
@@ -15,8 +16,9 @@ BINARY_VERSION ?= ${GIT_TAG}-${GIT_SHA}
IMAGE := ${DOCKER_REGISTRY}/${IMAGE_PREFIX}/${SHORT_NAME}:${DOCKER_VERSION}
MUTABLE_IMAGE := ${DOCKER_REGISTRY}/${IMAGE_PREFIX}/${SHORT_NAME}:${MUTABLE_VERSION}
LDFLAGS += -X k8s.io/helm/pkg/version.
SemVer
=${GIT_TAG}
LDFLAGS += -X k8s.io/helm/pkg/version.
Version
=${GIT_TAG}
LDFLAGS += -X k8s.io/helm/pkg/version.GitCommit=${GIT_COMMIT}
LDFLAGS += -X k8s.io/helm/pkg/version.GitTreeState=${GIT_DIRTY}
DOCKER_PUSH = docker push
ifeq ($(DOCKER_REGISTRY),gcr.io)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment