Skip to content
Snippets Groups Projects
Commit 957019af authored by Angus Lees's avatar Angus Lees Committed by GitHub
Browse files

Merge pull request #73 from anguslees/version

Report client-go version in `version` subcommand
parents d15f26f0 4d6290cf
No related branches found
No related tags found
No related merge requests found
language: go
go:
- 1.7.x
- 1.8.x
- 1.7.x
os:
- linux
- osx
env:
global:
- VERSION="${TRAVIS_TAG:-build-$TRAVIS_BUILD_ID}"
- EXTRA_GO_FLAGS_TEST="-race"
# Frequent jsonnet_cgo crashes with xcode7.3 (default)
osx_image: xcode8.3
matrix:
include:
- env: TARGET=x86_64-linux-musl
os: linux
- env: TARGET=x86_64-linux-musl EXTRA_GO_FLAGS_TEST=""
go: 1.8.x
exclude:
# cgo requires golang >= 1.8.1 (or other workarounds) on recent
# osx/xcode - see https://github.com/golang/go/issues/19734
- go: 1.7.x
os: osx
# 'go test' also hangs repeatably on go-1.8.3/MacOS ?
- os: osx
go: 1.8.x
fast_finish: true
allow_failures:
# Let us know if/when 'go test' works again on MacOS..
- os: osx
go: 1.8.x
addons:
apt:
......@@ -68,9 +75,9 @@ install:
- go build -i -ldflags "$GO_LDFLAGS" .
script:
- make VERSION=${TRAVIS_TAG:-build-$TRAVIS_BUILD_ID}
- make VERSION=${TRAVIS_TAG:-build-$TRAVIS_BUILD_ID} test
- make VERSION=${TRAVIS_TAG:-build-$TRAVIS_BUILD_ID} vet
- make VERSION="$VERSION" EXTRA_GO_FLAGS="$EXTRA_GO_FLAGS_TEST" test
- make vet
- rm -f ./kubecfg && make VERSION="$VERSION"
- >
ldd ./kubecfg || otool -L ./kubecfg || :
- ./kubecfg help
......
......@@ -16,7 +16,8 @@
VERSION = dev-$(shell date +%FT%T%z)
GO = go
GO_FLAGS = -ldflags="-X main.version=$(VERSION) $(GO_LDFLAGS)"
EXTRA_GO_FLAGS =
GO_FLAGS = -ldflags="-X main.version=$(VERSION) $(GO_LDFLAGS)" $(EXTRA_GO_FLAGS)
GOFMT = gofmt
JSONNET_FILES = lib/kubecfg_test.jsonnet examples/guestbook.jsonnet
......
......@@ -20,6 +20,7 @@ import (
"github.com/spf13/cobra"
jsonnet "github.com/strickyak/jsonnet_cgo"
"k8s.io/client-go/pkg/version"
)
func init() {
......@@ -36,5 +37,6 @@ var versionCmd = &cobra.Command{
out := cmd.OutOrStdout()
fmt.Fprintln(out, "kubecfg version:", Version)
fmt.Fprintln(out, "jsonnet version:", jsonnet.Version())
fmt.Fprintln(out, "client-go version:", version.Get())
},
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment