Skip to content

✨ Update releaser to use env variables #1974

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ coverage
cover.out

# Release output
dist/**
operator-controller.yaml
install.sh
catalogd.yaml
/dist/**
/operator-controller.yaml
/default-catalogs.yaml
/install.sh

# vendored files
vendor/
Expand Down
6 changes: 3 additions & 3 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ release:
disable: '{{ ne .Env.ENABLE_RELEASE_PIPELINE "true" }}'
mode: replace
extra_files:
- glob: 'operator-controller.yaml'
- glob: './config/catalogs/clustercatalogs/default-catalogs.yaml'
- glob: 'install.sh'
- glob: '{{ .Env.RELEASE_MANIFEST }}'
- glob: '{{ .Env.RELEASE_INSTALL }}'
- glob: '{{ .Env.RELEASE_CATALOGS }}'
header: |
## Installation

Expand Down
22 changes: 15 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ endif

KUSTOMIZE_BUILD_DIR := config/overlays/cert-manager

export RELEASE_MANIFEST := operator-controller.yaml
export RELEASE_INSTALL := install.sh
export RELEASE_CATALOGS := default-catalogs.yaml

CATALOGS_MANIFEST := ./config/catalogs/clustercatalogs/default-catalogs.yaml

# Disable -j flag for make
.NOTPARALLEL:

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

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

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

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

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

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

##@ Docs

Expand Down