Skip to content

Commit

Permalink
CR-5279 - As a user I'll be able to upgrade runtime to a specific ver…
Browse files Browse the repository at this point in the history
…sion (#19)
  • Loading branch information
ATGardner authored Jul 15, 2021
1 parent 75b1433 commit 618c52d
Show file tree
Hide file tree
Showing 18 changed files with 698 additions and 273 deletions.
23 changes: 6 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
VERSION=v0.0.24
VERSION=v0.0.25
OUT_DIR=dist
YEAR?=$(shell date +"%Y")

CLI_NAME?=cf
IMAGE_REPOSITORY?=quay.io
IMAGE_NAMESPACE?=codefresh

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

DEV_ARGOCD_INSTALLATION_MANIFESTS_URL="manifests/argo-cd"
DEV_EVENTS_INSTALLATION_MANIFESTS_URL="manifests/argo-events"
DEV_ROLLOUTS_INSTALLATION_MANIFESTS_URL="manifests/argo-rollouts"
DEV_WORKFLOWS_INSTALLATION_MANIFESTS_URL="manifests/argo-workflows"
DEV_RUNTIME_DEF_URL="manifests/runtime.yaml"

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

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

ifeq (${DEV_MODE},true)
ARGOCD_INSTALLATION_MANIFESTS_URL=${DEV_ARGOCD_INSTALLATION_MANIFESTS_URL}
EVENTS_INSTALLATION_MANIFESTS_URL=${DEV_EVENTS_INSTALLATION_MANIFESTS_URL}
ROLLOUTS_INSTALLATION_MANIFESTS_URL=${DEV_ROLLOUTS_INSTALLATION_MANIFESTS_URL}
WORKFLOWS_INSTALLATION_MANIFESTS_URL=${DEV_WORKFLOWS_INSTALLATION_MANIFESTS_URL}
RUNTIME_DEF_URL=${DEV_RUNTIME_DEF_URL}
endif

ifndef GOBIN
Expand Down Expand Up @@ -94,10 +85,7 @@ $(OUT_DIR)/$(CLI_NAME)-%: $(CLI_SRCS)
VERSION=$(VERSION) \
GIT_COMMIT=$(GIT_COMMIT) \
OUT_FILE=$(OUT_DIR)/$(CLI_NAME)-$* \
ARGOCD_INSTALLATION_MANIFESTS_URL=$(ARGOCD_INSTALLATION_MANIFESTS_URL) \
EVENTS_INSTALLATION_MANIFESTS_URL=$(EVENTS_INSTALLATION_MANIFESTS_URL) \
ROLLOUTS_INSTALLATION_MANIFESTS_URL=$(ROLLOUTS_INSTALLATION_MANIFESTS_URL) \
WORKFLOWS_INSTALLATION_MANIFESTS_URL=$(WORKFLOWS_INSTALLATION_MANIFESTS_URL) \
RUNTIME_DEF_URL=$(RUNTIME_DEF_URL) \
MAIN=./cmd \
./hack/build.sh

Expand All @@ -120,6 +108,7 @@ test:

.PHONY: codegen
codegen: $(GOBIN)/mockery
rm -f ./docs/commands/*
go generate ./...
go run ./hack/license.go --license ./hack/boilerplate.txt --year $(YEAR) .

Expand Down
8 changes: 5 additions & 3 deletions cmd/commands/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,10 @@ func NewConfigCurrentContextCommand() *cobra.Command {
func RunConfigCurrentContext(ctx context.Context) error {
cur := cfConfig.GetCurrentContext()
if cur.Name == "" {
log.G().Fatal(util.Doc("no currently selected context, use '<BIN> config use-context' to select a context"))
log.G(ctx).Fatal(util.Doc("no currently selected context, use '<BIN> config use-context' to select a context"))
}
log.G().Info(cur.Name)

log.G(ctx).Info(cur.Name)
return nil
}

Expand Down Expand Up @@ -188,6 +189,7 @@ func RunConfigDeleteContext(ctx context.Context, context string) error {
if err := cfConfig.DeleteContext(context); err != nil {
return err
}
log.G().Infof("delete context: %s", context)

log.G(ctx).Infof("delete context: %s", context)
return nil
}
Loading

0 comments on commit 618c52d

Please sign in to comment.