Skip to content

Commit

Permalink
Merge pull request #99 from jmunson/master
Browse files Browse the repository at this point in the history
Inject currentVersion at buildtime for `certmgr version`
  • Loading branch information
jmunson committed May 20, 2020
2 parents c90dfec + 2b1a451 commit 65718ed
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -15,7 +15,7 @@ jobs:
script:
- export SOURCE_DATE_EPOCH=$(git show -s --format=%ci ${TRAVIS_TAG:-${TRAVIS_COMMIT}})
- go get github.com/mitchellh/gox
- GOFLAGS=-mod=vendor gox -output="{{.Dir}}-{{.OS}}-{{.Arch}}-${TRAVIS_TAG:-${TRAVIS_COMMIT}}" -os='darwin dragonfly freebsd linux netbsd openbsd solaris' -osarch='!dragonfly/386 !darwin/arm64 !darwin/arm !linux/mips !linux/mipsle' -gcflags="-trimpath=${GOPATH}" ./certmgr/...
- GOFLAGS=-mod=vendor gox -output="{{.Dir}}-{{.OS}}-{{.Arch}}-${TRAVIS_TAG:-${TRAVIS_COMMIT}}" -os='darwin dragonfly freebsd linux netbsd openbsd solaris' -osarch='!dragonfly/386 !darwin/arm64 !darwin/arm !linux/mips !linux/mipsle' -gcflags="-trimpath=${GOPATH}" -ldflags="-X github.com/cloudflare/certmgr/certmgr/cmd.currentVersion=${TRAVIS_TAG:-${TRAVIS_COMMIT}}" ./certmgr/
- for i in certmgr-*; do tar --mtime="${SOURCE_DATE_EPOCH}" --owner=0 --group=0 --numeric-owner -c $i | gzip -n - > $i.tar.gz; done
- shasum -a 512 certmgr-*.tar.gz | tee sha512sum.txt
deploy:
Expand Down
3 changes: 2 additions & 1 deletion certmgr/cmd/version.go
Expand Up @@ -8,7 +8,8 @@ import (
"github.com/spf13/viper"
)

var currentVersion = "2.0.1"
// We override this at build time with a version number when built in travis
var currentVersion = "development"

var versionCmd = &cobra.Command{
Use: "version",
Expand Down

0 comments on commit 65718ed

Please sign in to comment.