Skip to content

Commit 687307e

Browse files
committed
rfactor
1 parent e4e7ed2 commit 687307e

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

.github/workflows/build.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,11 @@ jobs:
6969
- name: catalog
7070
if: startsWith(github.ref, 'refs/tags/v')
7171
run: |
72-
make catalog-build catalog-push VERSION=${{ env.VERSION }}
72+
make update-catalog-template catalog-build catalog-push VERSION=${{ env.VERSION }}
7373
7474
# re-tag as alpha, so that we can stick to a single channel
7575
echo re-tagging
76-
export CATALOG_BASE_IMG=ghcr.io/davidkarlsen/flyway-operator-catalog:alpha
77-
docker tag ghcr.io/davidkarlsen/flyway-operator-catalog:${{ env.GIT_VERSION }} ${CATALOG_BASE_IMG}
78-
docker push ${CATALOG_BASE_IMG}
76+
make catalog-retag VERSION=${{ env.VERSION }}
7977
8078
- name: createRelease
8179
if: startsWith(github.ref, 'refs/tags/v')

Makefile

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -256,24 +256,32 @@ OPM = $(shell which opm)
256256
endif
257257
endif
258258

259+
260+
update-catalog-template:
261+
yq -e '.Stable.Bundles += {"Image": "$(BUNDLE_IMG)" }' -i ./catalog-template.yaml
262+
git commit -m"Bump catalog material" catalog-template.yaml
263+
git push origin HEAD:main
264+
259265
# The image tag given to the resulting catalog image (e.g. make catalog-build CATALOG_IMG=example.com/operator-catalog:v0.2.0).
260266
CATALOG_IMG ?= $(IMAGE_TAG_BASE)-catalog:v$(VERSION)
267+
CATALOG_VERSIONLESS = ghcr.io/davidkarlsen/flyway-operator-catalog:alpha
261268

262269
# Build a catalog image by adding bundle images to an empty catalog using the operator package manager tool, 'opm'.
263270
# This recipe invokes 'opm' in 'semver' bundle add mode. For more information on add modes, see:
264271
# https://github.com/operator-framework/community-operators/blob/7f1438c/docs/packaging-operator.md#updating-your-existing-operator
265272
.PHONY: catalog-build
266273
catalog-build: opm
267-
yq -e '.Stable.Bundles += {"Image": "$(BUNDLE_IMG)" }' -i ./catalog-template.yaml
268-
git commit -m"Bump catalog material" catalog-template.yaml
269-
git push origin HEAD:main
270274
rm -rf catalog
271275
mkdir catalog
272-
opm alpha render-template semver -o yaml < catalog-template.yaml > catalog/catalog.yaml
273-
opm validate catalog
276+
$(OPM) alpha render-template semver -o yaml < catalog-template.yaml > catalog/catalog.yaml
277+
$(OPM) validate catalog
274278
docker build --platform=linux/amd64 -f Dockerfile.catalog -t $(CATALOG_IMG) .
275279

276280
# Push the catalog image.
277281
.PHONY: catalog-push
278282
catalog-push: ## Push a catalog image.
279283
$(MAKE) docker-push IMG=$(CATALOG_IMG)
284+
285+
catalog-retag:
286+
docker tag $(CATALOG_IMG) $(CATALOG_VERSIONLESS)
287+
docker push $(CATALOG_VERSIONLESS)

0 commit comments

Comments
 (0)