-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
60 lines (51 loc) · 2.82 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
49
50
51
52
53
54
55
56
57
58
59
60
ZOT_CONFIG_FILE := "./zot/config.json"
VENV := .venv
PYTHON := python3
#EXAMPLECONTAINERNAME := localhost:8081/examplecontainer2
#EXAMPLECONTAINERNAME := ghcr.io/gardenlinux/gl-oci
CONTAINER_NAME_example-zot := localhost:8081/examplecontainer2
CONTAINER_NAME_example-ghcr := https://ghcr.io/gardenlinux/gl-oci
CONTAINER_IMAGE_VERSION := today
ifneq (,$(wildcard ./.env))
include .env
export
endif
gencert:
./cert/gencert.sh
serve-oci:
zot serve $(ZOT_CONFIG_FILE)
#serve-oci-registry:
# mkdir -p output/registry
# podman run --rm -p 5000:8081 -v ./output/registry:/tmp/zot ghcr.io/project-zot/zot-linux-arm64:latest
activate_venv:
@echo "To activate venv in your shell run:"
@echo "source $(VENV)/bin/activate"
create_venv: ## Create a virtual environment.
$(PYTHON) -m venv $(VENV)
install_deps: ## Install dependencies.
$(VENV)/bin/pip install -r requirements.txt
example-%: gencert
@echo "==== DEMO ===="
@echo "=== Inspect oci-index"
$(PYTHON) -m gloci.cli image inspect-index --container $(CONTAINER_NAME_$@) --version $(CONTAINER_IMAGE_VERSION)
@echo "=== Push dummy container 1 arm64"
$(PYTHON) -m gloci.cli image push --container $(CONTAINER_NAME_$@) --version $(CONTAINER_IMAGE_VERSION) --architecture arm64 --cname yolo-example_dev --info_yaml example-data/info_1.yaml
@echo "=== Push dummy container 1 amd64"
$(PYTHON) -m gloci.cli image push --container $(CONTAINER_NAME_$@) --version $(CONTAINER_IMAGE_VERSION) --architecture amd64 --cname yolo-example_dev --info_yaml example-data/info_1.yaml
@echo "=== Push dummy container 2 arm64"
$(PYTHON) -m gloci.cli image push --container $(CONTAINER_NAME_$@) --version $(CONTAINER_IMAGE_VERSION) --architecture arm64 --cname yolo2-example_dev --info_yaml example-data/info_2.yaml
@echo "=== Push dummy container 2 amd64"
$(PYTHON) -m gloci.cli image push --container $(CONTAINER_NAME_$@) --version $(CONTAINER_IMAGE_VERSION) --architecture amd64 --cname yolo2-example_dev --info_yaml example-data/info_2.yaml
@echo "=== Attach an Extra file to dummy container 2 arm64"
$(PYTHON) -m gloci.cli image attach --container $(CONTAINER_NAME_$@) --version $(CONTAINER_IMAGE_VERSION) --cname yolo-example_dev --architecture arm64 --file_path example-data/extras --media_type application/vnd.oci.image.layer.v1.tar
@echo ""
@echo ""
@echo ""
@echo "=== Inspect oci-index"
$(PYTHON) -m gloci.cli image inspect-index --container $(CONTAINER_NAME_$@) --version $(CONTAINER_IMAGE_VERSION)
@echo "=== Inspect single manigest"
$(PYTHON) -m gloci.cli image inspect --container $(CONTAINER_NAME_$@) --version $(CONTAINER_IMAGE_VERSION) --cname yolo-example_dev --architecture arm64
@echo "=== Inspect single manigest"
$(PYTHON) -m gloci.cli image inspect --container $(CONTAINER_NAME_$@) --version $(CONTAINER_IMAGE_VERSION) --cname yolo-example_dev --architecture amd64
clean:
rm -rf output gl-oci.log