Skip to content

Commit 618c52d

Browse files
authored
CR-5279 - As a user I'll be able to upgrade runtime to a specific version (#19)
1 parent 75b1433 commit 618c52d

18 files changed

+698
-273
lines changed

Makefile

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
1-
VERSION=v0.0.24
1+
VERSION=v0.0.25
22
OUT_DIR=dist
33
YEAR?=$(shell date +"%Y")
44

55
CLI_NAME?=cf
66
IMAGE_REPOSITORY?=quay.io
77
IMAGE_NAMESPACE?=codefresh
88

9-
ARGOCD_INSTALLATION_MANIFESTS_URL="github.com/codefresh-io/cli-v2/manifests/argo-cd?ref=$(VERSION)"
10-
EVENTS_INSTALLATION_MANIFESTS_URL="github.com/codefresh-io/cli-v2/manifests/argo-events?ref=$(VERSION)"
11-
ROLLOUTS_INSTALLATION_MANIFESTS_URL="github.com/codefresh-io/cli-v2/manifests/argo-rollouts?ref=$(VERSION)"
12-
WORKFLOWS_INSTALLATION_MANIFESTS_URL="github.com/codefresh-io/cli-v2/manifests/argo-workflows?ref=$(VERSION)"
9+
RUNTIME_DEF_URL="https://github.com/codefresh-io/cli-v2/manifests/runtime.yaml"
1310

14-
DEV_ARGOCD_INSTALLATION_MANIFESTS_URL="manifests/argo-cd"
15-
DEV_EVENTS_INSTALLATION_MANIFESTS_URL="manifests/argo-events"
16-
DEV_ROLLOUTS_INSTALLATION_MANIFESTS_URL="manifests/argo-rollouts"
17-
DEV_WORKFLOWS_INSTALLATION_MANIFESTS_URL="manifests/argo-workflows"
11+
DEV_RUNTIME_DEF_URL="manifests/runtime.yaml"
1812

1913
CLI_SRCS := $(shell find . -name '*.go')
2014

@@ -26,10 +20,7 @@ BUILD_DATE=$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')
2620
DEV_MODE?=true
2721

2822
ifeq (${DEV_MODE},true)
29-
ARGOCD_INSTALLATION_MANIFESTS_URL=${DEV_ARGOCD_INSTALLATION_MANIFESTS_URL}
30-
EVENTS_INSTALLATION_MANIFESTS_URL=${DEV_EVENTS_INSTALLATION_MANIFESTS_URL}
31-
ROLLOUTS_INSTALLATION_MANIFESTS_URL=${DEV_ROLLOUTS_INSTALLATION_MANIFESTS_URL}
32-
WORKFLOWS_INSTALLATION_MANIFESTS_URL=${DEV_WORKFLOWS_INSTALLATION_MANIFESTS_URL}
23+
RUNTIME_DEF_URL=${DEV_RUNTIME_DEF_URL}
3324
endif
3425

3526
ifndef GOBIN
@@ -94,10 +85,7 @@ $(OUT_DIR)/$(CLI_NAME)-%: $(CLI_SRCS)
9485
VERSION=$(VERSION) \
9586
GIT_COMMIT=$(GIT_COMMIT) \
9687
OUT_FILE=$(OUT_DIR)/$(CLI_NAME)-$* \
97-
ARGOCD_INSTALLATION_MANIFESTS_URL=$(ARGOCD_INSTALLATION_MANIFESTS_URL) \
98-
EVENTS_INSTALLATION_MANIFESTS_URL=$(EVENTS_INSTALLATION_MANIFESTS_URL) \
99-
ROLLOUTS_INSTALLATION_MANIFESTS_URL=$(ROLLOUTS_INSTALLATION_MANIFESTS_URL) \
100-
WORKFLOWS_INSTALLATION_MANIFESTS_URL=$(WORKFLOWS_INSTALLATION_MANIFESTS_URL) \
88+
RUNTIME_DEF_URL=$(RUNTIME_DEF_URL) \
10189
MAIN=./cmd \
10290
./hack/build.sh
10391

@@ -120,6 +108,7 @@ test:
120108

121109
.PHONY: codegen
122110
codegen: $(GOBIN)/mockery
111+
rm -f ./docs/commands/*
123112
go generate ./...
124113
go run ./hack/license.go --license ./hack/boilerplate.txt --year $(YEAR) .
125114

cmd/commands/config.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,10 @@ func NewConfigCurrentContextCommand() *cobra.Command {
132132
func RunConfigCurrentContext(ctx context.Context) error {
133133
cur := cfConfig.GetCurrentContext()
134134
if cur.Name == "" {
135-
log.G().Fatal(util.Doc("no currently selected context, use '<BIN> config use-context' to select a context"))
135+
log.G(ctx).Fatal(util.Doc("no currently selected context, use '<BIN> config use-context' to select a context"))
136136
}
137-
log.G().Info(cur.Name)
137+
138+
log.G(ctx).Info(cur.Name)
138139
return nil
139140
}
140141

@@ -188,6 +189,7 @@ func RunConfigDeleteContext(ctx context.Context, context string) error {
188189
if err := cfConfig.DeleteContext(context); err != nil {
189190
return err
190191
}
191-
log.G().Infof("delete context: %s", context)
192+
193+
log.G(ctx).Infof("delete context: %s", context)
192194
return nil
193195
}

0 commit comments

Comments
 (0)