Skip to content

Commit a5ec854

Browse files
committed
Update releaser to use env variables
In anticipation of config changes. Use environment variables for the release values. Update the Makefile to use the same variables. Signed-off-by: Todd Short <[email protected]>
1 parent cecd003 commit a5ec854

File tree

3 files changed

+22
-14
lines changed

3 files changed

+22
-14
lines changed

.gitignore

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ coverage
1919
cover.out
2020

2121
# Release output
22-
dist/**
23-
operator-controller.yaml
24-
install.sh
25-
catalogd.yaml
22+
/dist/**
23+
/operator-controller.yaml
24+
/default-catalogs.yaml
25+
/install.sh
2626

2727
# vendored files
2828
vendor/

.goreleaser.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@ release:
124124
disable: '{{ ne .Env.ENABLE_RELEASE_PIPELINE "true" }}'
125125
mode: replace
126126
extra_files:
127-
- glob: 'operator-controller.yaml'
128-
- glob: './config/catalogs/clustercatalogs/default-catalogs.yaml'
129-
- glob: 'install.sh'
127+
- glob: '{{ .Env.RELEASE_MANIFEST }}'
128+
- glob: '{{ .Env.RELEASE_INSTALL }}'
129+
- glob: '{{ .Env.RELEASE_CATALOGS }}'
130130
header: |
131131
## Installation
132132

Makefile

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,12 @@ endif
7979

8080
KUSTOMIZE_BUILD_DIR := config/overlays/cert-manager
8181

82+
export RELEASE_MANIFEST := operator-controller.yaml
83+
export RELEASE_INSTALL := install.sh
84+
export RELEASE_CATALOGS := default-catalogs.yaml
85+
86+
CATALOGS_MANIFEST := ./config/catalogs/clustercatalogs/default-catalogs.yaml
87+
8288
# Disable -j flag for make
8389
.NOTPARALLEL:
8490

@@ -260,7 +266,7 @@ extension-developer-e2e: run image-registry test-ext-dev-e2e kind-clean #EXHELP
260266

261267
.PHONY: run-latest-release
262268
run-latest-release:
263-
curl -L -s https://github.com/operator-framework/operator-controller/releases/latest/download/install.sh | bash -s
269+
curl -L -s https://github.com/operator-framework/operator-controller/releases/latest/download/$(notdir $(RELEASE_INSTALL)) | bash -s
264270

265271
.PHONY: pre-upgrade-setup
266272
pre-upgrade-setup:
@@ -288,10 +294,11 @@ kind-load: $(KIND) #EXHELP Loads the currently constructed images into the KIND
288294
$(CONTAINER_RUNTIME) save $(CATD_IMG) | $(KIND) load image-archive /dev/stdin --name $(KIND_CLUSTER_NAME)
289295

290296
.PHONY: kind-deploy
291-
kind-deploy: export MANIFEST := ./operator-controller.yaml
292-
kind-deploy: export DEFAULT_CATALOG := ./config/catalogs/clustercatalogs/default-catalogs.yaml
297+
kind-deploy: export MANIFEST := $(RELEASE_MANIFEST)
298+
kind-deploy: export DEFAULT_CATALOG := $(RELEASE_CATALOGS)
293299
kind-deploy: manifests $(KUSTOMIZE)
294300
$(KUSTOMIZE) build $(KUSTOMIZE_BUILD_DIR) | sed "s/cert-git-version/cert-$(VERSION)/g" > $(MANIFEST)
301+
cp $(CATALOGS_MANIFEST) $(DEFAULT_CATALOG)
295302
envsubst '$$DEFAULT_CATALOG,$$CERT_MGR_VERSION,$$INSTALL_DEFAULT_CATALOGS,$$MANIFEST' < scripts/install.tpl.sh | bash -s
296303

297304
.PHONY: kind-cluster
@@ -381,11 +388,12 @@ release: $(GORELEASER) #EXHELP Runs goreleaser for the operator-controller. By d
381388
OPCON_IMAGE_REPO=$(OPCON_IMAGE_REPO) CATD_IMAGE_REPO=$(CATD_IMAGE_REPO) $(GORELEASER) $(GORELEASER_ARGS)
382389

383390
.PHONY: quickstart
384-
quickstart: export MANIFEST := https://github.com/operator-framework/operator-controller/releases/download/$(VERSION)/operator-controller.yaml
385-
quickstart: export DEFAULT_CATALOG := "https://github.com/operator-framework/operator-controller/releases/download/$(VERSION)/default-catalogs.yaml"
391+
quickstart: export MANIFEST := "https://github.com/operator-framework/operator-controller/releases/download/$(VERSION)/$(notdir $(RELEASE_MANIFEST))"
392+
quickstart: export DEFAULT_CATALOG := "https://github.com/operator-framework/operator-controller/releases/download/$(VERSION)/$(notdir $(RELEASE_CATALOGS))"
386393
quickstart: $(KUSTOMIZE) manifests #EXHELP Generate the unified installation release manifests and scripts.
387-
$(KUSTOMIZE) build $(KUSTOMIZE_BUILD_DIR) | sed "s/cert-git-version/cert-$(VERSION)/g" | sed "s/:devel/:$(VERSION)/g" > operator-controller.yaml
388-
envsubst '$$DEFAULT_CATALOG,$$CERT_MGR_VERSION,$$INSTALL_DEFAULT_CATALOGS,$$MANIFEST' < scripts/install.tpl.sh > install.sh
394+
$(KUSTOMIZE) build $(KUSTOMIZE_BUILD_DIR) | sed "s/cert-git-version/cert-$(VERSION)/g" | sed "s/:devel/:$(VERSION)/g" > $(RELEASE_MANIFEST)
395+
cp $(CATALOGS_MANIFEST) $(RELEASE_CATALOGS)
396+
envsubst '$$DEFAULT_CATALOG,$$CERT_MGR_VERSION,$$INSTALL_DEFAULT_CATALOGS,$$MANIFEST' < scripts/install.tpl.sh > $(RELEASE_INSTALL)
389397

390398
##@ Docs
391399

0 commit comments

Comments
 (0)