-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathMakefile
45 lines (40 loc) · 1.75 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
VERSION := v1.8.3
BUNDLE_IMG ?= quay.io/skupper/skupper-operator-bundle:$(VERSION)
INDEX_IMG ?= quay.io/skupper/skupper-operator-index:$(VERSION)
OPM_URL := https://github.com/operator-framework/operator-registry/releases/latest/download/linux-amd64-opm
OPM := $(or $(shell which opm 2> /dev/null),./opm)
CONTAINER_TOOL := podman
CATALOG_YAML := skupper-operator-index/skupper-operator/catalog.yaml
PLATFORMS ?= linux/amd64,linux/arm64
all: index-build
.PHONY: bundle-build ## Build the bundle image.
bundle-build: test
@echo Building bundle image
$(CONTAINER_TOOL) buildx build --no-cache --platform ${PLATFORMS} --manifest skupper-operator-bundle -f bundle.Dockerfile -t $(BUNDLE_IMG) .
@echo Pushing $(BUNDLE_IMG)
$(CONTAINER_TOOL) manifest push --all skupper-operator-bundle $(BUNDLE_IMG)
.PHONY: opm-download
opm-download:
@echo Checking if $(OPM) is available
ifeq (,$(wildcard $(OPM)))
wget --quiet $(OPM_URL) -O ./opm && chmod +x ./opm
endif
.PHONY: index-build ## Build the index image.
index-build: bundle-build opm-download
$(info Using OPM Tool: $(OPM))
@echo Adding unique $(VERSION) entry to catalog.yaml
@python ./scripts/index_update.py $(CATALOG_YAML)
@echo Adding bundle to the catalog
$(OPM) render $(BUNDLE_IMG) --output yaml >> $(CATALOG_YAML)
$(OPM) validate skupper-operator-index/
@echo Building index image
$(CONTAINER_TOOL) buildx build --no-cache --platform ${PLATFORMS} --manifest skupper-operator-index -f skupper-operator-index.Dockerfile -t $(INDEX_IMG) .
@echo Pushing $(INDEX_IMG)
$(CONTAINER_TOOL) manifest push --all skupper-operator-index $(INDEX_IMG)
.PHONY: test
test:
@rm -rf ./tmp || true
mkdir ./tmp
cp -r bundle/manifests/$(subst v,,$(VERSION)) ./tmp/manifests
cp -r bundle/metadata ./tmp
operator-sdk bundle validate ./tmp