-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
65 lines (52 loc) · 1.99 KB
/
Makefile
File metadata and controls
65 lines (52 loc) · 1.99 KB
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
61
62
63
64
65
IMAGE_TAG ?= "latest"
DEPLOYMENT_FILE ?= "./operator/manifests/deployment.yaml"
# setup kind: add storage class, cert manager etc
# TODO change the sleep with a check on cnpg and cert manager
.PHONY: setup-kind
setup-kind:
kubectl apply --server-side -f https://raw.githubusercontent.com/cloudnative-pg/cloudnative-pg/release-1.26/releases/cnpg-1.26.0.yaml
kubectl apply -f https://raw.githubusercontent.com/rancher/local-path-provisioner/v0.0.31/deploy/local-path-storage.yaml
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/latest/download/cert-manager.yaml
sleep 20
kubectl apply -f https://github.com/cloudnative-pg/plugin-barman-cloud/releases/download/v0.5.0/manifest.yaml
# awk use $$ for escaping
.PHONY: start-dev
start-dev:
docker ps -a | grep checkmydump | awk '{print $$1}' | xargs docker restart
.PHONY: stop-dev
stop-dev:
docker ps -a | grep checkmydump | awk '{print $$1}' | xargs docker stop
.PHONY: run-dev
run-dev:
cd operator && uv run kopf run main.py
.PHONY: build
build:
cd operator && uv pip freeze > requirements.txt
yq e ".spec.template.spec.containers[0].image = \"$(REPOSITORY):$(IMAGE_TAG)\"" -i $(DEPLOYMENT_FILE)
docker build -t $(REPOSITORY):$(IMAGE_TAG) operator/
.PHONY: push
push: build
docker push $(REPOSITORY):$(IMAGE_TAG)
.PHONY: load-kind
load-kind:
kind load docker-image $(REPOSITORY):$(IMAGE_TAG) --name checkmydump
.PHONY: deploy-crd
deploy-crd:
kubectl apply -f ./operator/manifests/namespace.yaml
kubectl apply -f ./operator/manifests/crd.yaml
kubectl apply -f ./operator/manifests/rbac.yaml
.PHONY: deploy
deploy: deploy-crd
kubectl apply -f $(DEPLOYMENT_FILE)
.PHONY: deploy-local
deploy-local: load-kind deploy
.PHONY: cleanup-crd
cleanup-crd:
kubectl delete -f ./operator/manifests/crd.yaml
kubectl delete -f ./operator/manifests/rbac.yaml
kubectl delete -f ./operator/manifests/namespace.yaml
.PHONY: cleanup-operator
cleanup-operator:
kubectl delete -f $(DEPLOYMENT_FILE)
.PHONY: cleanup
cleanup: cleanup-operator cleanup-crd