-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
41 lines (35 loc) · 1.16 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
## Tools
TOOLS_DIR = $(shell pwd)/.tmp/bin
OPM=$(TOOLS_DIR)/opm
OPM_VERSION = v1.47.0
.PHONY: generate
generate: generate-catalog
.PHONY: generate-catalog
generate-catalog: $(OPM)
$(OPM) alpha render-template basic --output yaml --migrate-level bundle-object-to-csv-metadata catalog/catalog-template.yaml > catalog/coo-product/catalog.yaml
# pre 4.17 the catalog should have bundle-object
$(OPM) alpha render-template basic --output yaml catalog/catalog-template.yaml > catalog/coo-product-4.16/catalog.yaml
$(TOOLS_DIR):
@mkdir -p $(TOOLS_DIR)
.PHONY: opm
$(OPM) opm: $(TOOLS_DIR)
@{ \
[[ -f $(OPM) ]] && exit 0 ;\
set -ex ;\
OS=$(shell go env GOOS) && ARCH=$(shell go env GOARCH) && \
curl -sSLo $(OPM) https://github.com/operator-framework/operator-registry/releases/download/$(OPM_VERSION)/$${OS}-$${ARCH}-opm ;\
chmod +x $(OPM) ;\
}
# Install all required tools
.PHONY: tools
tools: $(OPM)
@{ \
set -ex ;\
tools_file=.github/tools ;\
echo '# DO NOT EDIT! Autogenerated by make tools' > $$tools_file ;\
echo '' >> $$tools_file ;\
echo $$(basename $(OPM)) $(OPM_VERSION) >> $$tools_file ;\
}
.PHONY: clean-tools
clean-tools:
rm -rf $(TOOLS_DIR)