mirror of https://github.com/kubernetes/kops.git
parent
357a2e8f76
commit
6a23c82d63
11
Makefile
11
Makefile
|
@ -49,6 +49,7 @@ ifndef VERSION
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
GITSHA := $(shell git describe --always)
|
||||||
|
|
||||||
# Go exports:
|
# Go exports:
|
||||||
|
|
||||||
|
@ -63,7 +64,7 @@ ifdef STATIC_BUILD
|
||||||
endif
|
endif
|
||||||
|
|
||||||
kops: kops-gobindata
|
kops: kops-gobindata
|
||||||
go install ${EXTRA_BUILDFLAGS} -ldflags "-X k8s.io/kops.Version=${VERSION} ${EXTRA_LDFLAGS}" k8s.io/kops/cmd/kops/...
|
go install ${EXTRA_BUILDFLAGS} -ldflags "-X k8s.io/kops.Version=${VERSION} -X k8s.io/kops.GitVersion=${GITSHA} ${EXTRA_LDFLAGS}" k8s.io/kops/cmd/kops/...
|
||||||
|
|
||||||
gobindata-tool:
|
gobindata-tool:
|
||||||
go build ${EXTRA_BUILDFLAGS} -ldflags "${EXTRA_LDFLAGS}" -o ${GOPATH_1ST}/bin/go-bindata k8s.io/kops/vendor/github.com/jteeuwen/go-bindata/go-bindata
|
go build ${EXTRA_BUILDFLAGS} -ldflags "${EXTRA_LDFLAGS}" -o ${GOPATH_1ST}/bin/go-bindata k8s.io/kops/vendor/github.com/jteeuwen/go-bindata/go-bindata
|
||||||
|
@ -100,7 +101,7 @@ test:
|
||||||
|
|
||||||
crossbuild-nodeup:
|
crossbuild-nodeup:
|
||||||
mkdir -p .build/dist/
|
mkdir -p .build/dist/
|
||||||
GOOS=linux GOARCH=amd64 go build -a ${EXTRA_BUILDFLAGS} -o .build/dist/linux/amd64/nodeup -ldflags "${EXTRA_LDFLAGS} -X k8s.io/kops.Version=${VERSION}" k8s.io/kops/cmd/nodeup
|
GOOS=linux GOARCH=amd64 go build -a ${EXTRA_BUILDFLAGS} -o .build/dist/linux/amd64/nodeup -ldflags "${EXTRA_LDFLAGS} -X k8s.io/kops.Version=${VERSION} -X k8s.io/kops.GitVersion=${GITSHA}" k8s.io/kops/cmd/nodeup
|
||||||
|
|
||||||
crossbuild-nodeup-in-docker:
|
crossbuild-nodeup-in-docker:
|
||||||
docker pull golang:${GOVERSION} # Keep golang image up to date
|
docker pull golang:${GOVERSION} # Keep golang image up to date
|
||||||
|
@ -109,8 +110,8 @@ crossbuild-nodeup-in-docker:
|
||||||
|
|
||||||
crossbuild:
|
crossbuild:
|
||||||
mkdir -p .build/dist/
|
mkdir -p .build/dist/
|
||||||
GOOS=darwin GOARCH=amd64 go build -a ${EXTRA_BUILDFLAGS} -o .build/dist/darwin/amd64/kops -ldflags "${EXTRA_LDFLAGS} -X k8s.io/kops.Version=${VERSION}" k8s.io/kops/cmd/kops
|
GOOS=darwin GOARCH=amd64 go build -a ${EXTRA_BUILDFLAGS} -o .build/dist/darwin/amd64/kops -ldflags "${EXTRA_LDFLAGS} -X k8s.io/kops.Version=${VERSION} -X k8s.io/kops.GitVersion=${GITSHA}" k8s.io/kops/cmd/kops
|
||||||
GOOS=linux GOARCH=amd64 go build -a ${EXTRA_BUILDFLAGS} -o .build/dist/linux/amd64/kops -ldflags "${EXTRA_LDFLAGS} -X k8s.io/kops.Version=${VERSION}" k8s.io/kops/cmd/kops
|
GOOS=linux GOARCH=amd64 go build -a ${EXTRA_BUILDFLAGS} -o .build/dist/linux/amd64/kops -ldflags "${EXTRA_LDFLAGS} -X k8s.io/kops.Version=${VERSION} -X k8s.io/kops.GitVersion=${GITSHA}" k8s.io/kops/cmd/kops
|
||||||
|
|
||||||
crossbuild-in-docker:
|
crossbuild-in-docker:
|
||||||
docker pull golang:${GOVERSION} # Keep golang image up to date
|
docker pull golang:${GOVERSION} # Keep golang image up to date
|
||||||
|
@ -196,7 +197,7 @@ protokube-push: protokube-image
|
||||||
nodeup: nodeup-dist
|
nodeup: nodeup-dist
|
||||||
|
|
||||||
nodeup-gocode: kops-gobindata
|
nodeup-gocode: kops-gobindata
|
||||||
go install ${EXTRA_BUILDFLAGS} -ldflags "${EXTRA_LDFLAGS} -X k8s.io/kops.Version=${VERSION}" k8s.io/kops/cmd/nodeup
|
go install ${EXTRA_BUILDFLAGS} -ldflags "${EXTRA_LDFLAGS} -X k8s.io/kops.Version=${VERSION} -X k8s.io/kops.GitVersion=${GITSHA}" k8s.io/kops/cmd/nodeup
|
||||||
|
|
||||||
nodeup-dist:
|
nodeup-dist:
|
||||||
docker pull golang:${GOVERSION} # Keep golang image up to date
|
docker pull golang:${GOVERSION} # Keep golang image up to date
|
||||||
|
|
|
@ -47,7 +47,11 @@ func init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *VersionCmd) Run() error {
|
func (c *VersionCmd) Run() error {
|
||||||
fmt.Printf("Version %s\n", kops.Version)
|
s := "Version " + kops.Version
|
||||||
|
if kops.GitVersion != "" {
|
||||||
|
s += " (git-" + kops.GitVersion + ")"
|
||||||
|
}
|
||||||
|
fmt.Println(s)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,21 +20,21 @@ import (
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/golang/glog"
|
"github.com/golang/glog"
|
||||||
|
"k8s.io/kops"
|
||||||
"k8s.io/kops/upup/models"
|
"k8s.io/kops/upup/models"
|
||||||
"k8s.io/kops/upup/pkg/fi/nodeup"
|
"k8s.io/kops/upup/pkg/fi/nodeup"
|
||||||
"os"
|
"os"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
|
||||||
// value overwritten during build. This can be used to resolve issues.
|
|
||||||
BuildVersion = "0.1"
|
|
||||||
)
|
|
||||||
|
|
||||||
const retryInterval = 30 * time.Second
|
const retryInterval = 30 * time.Second
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
fmt.Printf("nodeup version %s\n", BuildVersion)
|
gitVersion := ""
|
||||||
|
if kops.GitVersion != "" {
|
||||||
|
gitVersion = " (git-" + kops.GitVersion + ")"
|
||||||
|
}
|
||||||
|
fmt.Printf("nodeup version %s%s\n", kops.Version, gitVersion)
|
||||||
|
|
||||||
var flagConf string
|
var flagConf string
|
||||||
flag.StringVar(&flagConf, "conf", "node.yaml", "configuration location")
|
flag.StringVar(&flagConf, "conf", "node.yaml", "configuration location")
|
||||||
|
|
|
@ -19,6 +19,9 @@ package kops
|
||||||
// This should be replaced by the makefile
|
// This should be replaced by the makefile
|
||||||
var Version = "1.5.0"
|
var Version = "1.5.0"
|
||||||
|
|
||||||
|
// This should be replaced by the makefile
|
||||||
|
var GitVersion = ""
|
||||||
|
|
||||||
// DefaultProtokubeImageName is the name of the protokube image, as we would pass to "docker run"
|
// DefaultProtokubeImageName is the name of the protokube image, as we would pass to "docker run"
|
||||||
func DefaultProtokubeImageName() string {
|
func DefaultProtokubeImageName() string {
|
||||||
return "protokube:" + Version
|
return "protokube:" + Version
|
||||||
|
|
Loading…
Reference in New Issue