-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
48 lines (39 loc) · 1.15 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
46
47
48
CATALOG_IMG ?= quay-its.epfl.ch/svc0041/isas-fsd-catalog:latest
.PHONY: build
build:
docker build -t $(CATALOG_IMG) .
.PHONY: push
push:
docker push $(CATALOG_IMG)
##############################################################################
.PHONY: dev
dev: venv opm
venv: requirements.txt requirements-dev.txt
rm -rf $@; mkdir $@
python3 -m venv venv
@( . venv/bin/activate; set -e -x; \
pip3 install -r requirements.txt -r requirements-dev.txt )
.PHONY: test
test: dev
env PATH="$$PATH:$$PWD/bin" ./venv/bin/python3 make-catalog.py \
$(wildcard *-olm.yaml) --configs-out configs --cache-out tmp/cache
cat configs/index.yaml
OS := $(shell uname -s | tr '[:upper:]' '[:lower:]')
ARCH := $(shell uname -m | sed 's/x86_64/amd64/' | sed 's/aarch64/arm64/')
.PHONY: opm
OPM = ./bin/opm
opm: ## Download opm locally if necessary.
ifeq (,$(wildcard $(OPM)))
ifeq (,$(shell which opm 2>/dev/null))
@{ \
set -e ;\
mkdir -p $(dir $(OPM)) ;\
curl -sSLo $(OPM) https://github.com/operator-framework/operator-registry/releases/download/v1.23.0/$(OS)-$(ARCH)-opm ;\
chmod +x $(OPM) ;\
}
else
OPM = $(shell which opm)
endif
endif
clean:
rm -rf config/ tmp/