Skip to content

Commit

Permalink
Add kyma version env var (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
Suleyman Akbas authored Jun 11, 2019
1 parent dd4904a commit c357698
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 123 deletions.
3 changes: 2 additions & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ before:
builds:
- env:
- CGO_ENABLED=0
ldflags: -X github.com/kyma-project/cli/pkg/kyma/cmd.Version={{.Version}}
- KYMA_VERSION=1.2.0-rc1
ldflags: -X github.com/kyma-project/cli/pkg/kyma/cmd.Version={{.Version}} -X github.com/kyma-project/cli/pkg/kyma/cmd/install.DefaultKymaVersion={{.Env.KYMA_VERSION}}
main: ./cmd/kyma/
archives:
- replacements:
Expand Down
95 changes: 3 additions & 92 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ required = [
name = "github.com/fsouza/go-dockerclient"
version = "1.3.5"

[[constraint]]
name = "github.com/kyma-project/kyma"
version = "1.1.0"

[[constraint]]
name = "github.com/pkg/errors"
version = "0.8.1"
Expand Down
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
.DEFAULT_GOAL := local

KYMA_VERSION = 1.2.0-rc1

ifndef VERSION
VERSION = ${shell git describe --tags --always}
endif

FLAGS = -ldflags '-X github.com/kyma-project/cli/pkg/kyma/cmd.Version=$(VERSION)'
FLAGS = -ldflags '-X github.com/kyma-project/cli/pkg/kyma/cmd.Version=$(VERSION) -X github.com/kyma-project/cli/pkg/kyma/cmd/install.DefaultKymaVersion=$(KYMA_VERSION)'

.PHONY: resolve
resolve:
Expand Down
24 changes: 0 additions & 24 deletions internal/installer/installer.go

This file was deleted.

2 changes: 1 addition & 1 deletion pkg/kyma/cmd/install/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ The command:
Aliases: []string{"i"},
}

cobraCmd.Flags().StringVarP(&o.ReleaseVersion, "release", "r", "1.1.0", "Kyma release to use")
cobraCmd.Flags().StringVarP(&o.ReleaseVersion, "release", "r", DefaultKymaVersion, "Kyma release to use")
cobraCmd.Flags().StringVarP(&o.ReleaseConfig, "config", "c", "", "URL or path to the Installer configuration YAML file")
cobraCmd.Flags().BoolVarP(&o.NoWait, "noWait", "n", false, "Do not wait for the Installer configuration to complete")
cobraCmd.Flags().StringVarP(&o.Domain, "domain", "d", "kyma.local", "Domain used for installation")
Expand Down
3 changes: 3 additions & 0 deletions pkg/kyma/cmd/install/opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import (
"github.com/kyma-project/cli/pkg/kyma/core"
)

//DefaultKymaVersion contains the default Kyma version to be installed in case another version is not specified
var DefaultKymaVersion string

type overrideFileList []string

func (ovf *overrideFileList) String() string {
Expand Down

0 comments on commit c357698

Please sign in to comment.