File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -144,7 +144,7 @@ parallel(
144144 }
145145
146146 make ' bootstrap'
147- env. VERSION = git_commit. take(7 )
147+ env. REVISION = git_commit. take(7 )
148148 make ' build-revision'
149149
150150 upload_artifacts()
Original file line number Diff line number Diff line change 88 GOOS=linux
99endif
1010
11+ # The latest git tag on branch
12+ GIT_TAG := $(shell git describe --abbrev=0 --tags)
13+ # If the latest commit is tagged
14+ TAGGED_COMMIT := $(shell git tag -l --contains HEAD)
15+ REVISION ?= $(shell git rev-parse --short HEAD)
16+
17+ ifdef TAGGED_COMMIT
18+ VERSION ?= ${GIT_TAG}
19+ else
20+ VERSION ?= ${GIT_TAG}-${REVISION}
21+ endif
22+
1123BUILD_OS ?=linux darwin windows
1224BUILD_ARCH ?=amd64 386
1325
@@ -18,13 +30,9 @@ DEV_ENV_PREFIX_CGO_ENABLED := docker run --rm -e CGO_ENABLED=1 -v ${CURDIR}:${DE
1830DEV_ENV_CMD := ${DEV_ENV_PREFIX} ${DEV_ENV_IMAGE}
1931DIST_DIR := _dist
2032
21- GO_LDFLAGS = -ldflags "-s -X ${repo_path}/version.BuildVersion =${VERSION}"
33+ GO_LDFLAGS = -ldflags "-s -X ${repo_path}/version.Version =${VERSION}"
2234GOTEST = go test --race
2335
24- # The tag of the commit
25- GIT_TAG := $(shell git tag -l --contains HEAD)
26- VERSION ?= $(shell git rev-parse --short HEAD)
27-
2836# UID and GID of local user
2937UID := $(shell id -u)
3038GID := $(shell id -g)
@@ -51,10 +59,10 @@ build-latest:
5159 ${DEV_ENV_CMD} gox -verbose -parallel=3 ${GO_LDFLAGS} -os=" ${BUILD_OS} " -arch=" ${BUILD_ARCH} " -output=" $( DIST_DIR) /deis-latest-{{.OS}}-{{.Arch}}" .
5260
5361build-revision :
54- ifdef GIT_TAG
62+ ifdef TAGGED_COMMIT
5563 ${DEV_ENV_CMD} gox -verbose -parallel=3 ${GO_LDFLAGS} -os="${BUILD_OS}" -arch="${BUILD_ARCH}" -output="$(DIST_DIR)/${GIT_TAG}/deis-${GIT_TAG}-{{.OS}}-{{.Arch}}" .
5664else
57- ${DEV_ENV_CMD} gox -verbose -parallel=3 ${GO_LDFLAGS} -os="${BUILD_OS}" -arch="${BUILD_ARCH}" -output="$(DIST_DIR)/${VERSION }/deis-${VERSION }-{{.OS}}-{{.Arch}}" .
65+ ${DEV_ENV_CMD} gox -verbose -parallel=3 ${GO_LDFLAGS} -os="${BUILD_OS}" -arch="${BUILD_ARCH}" -output="$(DIST_DIR)/${REVISION }/deis-${REVISION }-{{.OS}}-{{.Arch}}" .
5866endif
5967
6068build-all : build-latest build-revision
Original file line number Diff line number Diff line change @@ -20,11 +20,7 @@ Use 'deis help [command]' to learn more.
2020 return err
2121 }
2222
23- v := version .Version
24- if version .BuildVersion != "" {
25- v = fmt .Sprintf ("%s-%s" , version .Version , version .BuildVersion )
26- }
27- fmt .Println (v )
23+ fmt .Println (version .Version )
2824
2925 return nil
3026}
Original file line number Diff line number Diff line change @@ -11,14 +11,12 @@ import (
1111 "github.com/deis/workflow-cli/version"
1212)
1313
14- const (
15- // UserAgent is the user agent used by the CLI
16- UserAgent = "Deis Client v" + version . Version
14+ // DefaultResponseLimit is the default number of responses to return on requests that can
15+ // be limited.
16+ const DefaultResponseLimit = 100
1717
18- // DefaultResponseLimit is the default number of responses to return on requests that can
19- // be limited.
20- DefaultResponseLimit = 100
21- )
18+ // UserAgent is the user agent used by the CLI
19+ var UserAgent = "Deis Client v" + version .Version
2220
2321type settingsFile struct {
2422 Username string `json:"username"`
Original file line number Diff line number Diff line change 11package version
22
3- // Version identifies this Deis product revision.
4- const Version = "2.3.0"
5-
6- // BuildVersion is the git revision of the build.
3+ // Version identifies the Deis product revision.
74// Note: This value is overwritten by the linker during build
8- var BuildVersion = ""
5+ var Version = "unknown version (override me) "
You can’t perform that action at this time.
0 commit comments