forked from hoprnet/hoprd-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
58 lines (43 loc) · 3.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
49
50
51
52
53
54
55
56
57
58
.PHONY: help
help: ## Show help of available commands
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' Makefile | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
gcp-login: ## Login into GCP
gcloud auth configure-docker europe-west3-docker.pkg.dev
gcloud auth application-default print-access-token | helm registry login -u oauth2accesstoken --password-stdin https://europe-west3-docker.pkg.dev
build: ## Rust build
cargo build
run: ## Rust run
nohup cargo run &
helm-test: ## Print helm resources
helm install --dry-run --namespace hoprd-operator --create-namespace -f ./charts/hoprd-operator/values-stage.yaml hoprd-operator ./charts/hoprd-operator/
helm-lint: ## Lint Helm
helm lint ./charts/hoprd-operator
helm lint ./charts/cluster-hoprd
helm-install: ## Install helm chart using values-stage.yaml file
helm install --namespace hoprd-operator --create-namespace -f ./charts/hoprd-operator/values-stage.yaml hoprd-operator ./charts/hoprd-operator/
helm-uninstall: ## Uninstall helm chart
helm uninstall --namespace hoprd-operator hoprd-operator
helm-upgrade: ## Update helm-chart templates into cluster and remove deployment to be run within VsCode in debug mode
helm upgrade --namespace hoprd-operator --create-namespace -f ./charts/hoprd-operator/values-stage.yaml hoprd-operator ./charts/hoprd-operator/
# sleep 3
# kubectl delete deployment -n hoprd-operator hoprd-operator-controller
helm-package: ## Creates helm package
helm package charts/hoprd-operator --version $$(yq '.version' charts/hoprd-operator/Chart.yaml)
helm package charts/cluster-hoprd --version $$(yq '.version' charts/cluster-hoprd/Chart.yaml)
helm-publish: ## Deploys helm package to GCP artifact registry
helm push hoprd-operator-$$(yq '.version' charts/hoprd-operator/Chart.yaml).tgz oci://europe-west3-docker.pkg.dev/hoprassociation/helm-charts
helm push cluster-hoprd-$$(yq '.version' charts/cluster-hoprd/Chart.yaml).tgz oci://europe-west3-docker.pkg.dev/hoprassociation/helm-charts
docker-build: ## Builds docker image
docker build -t europe-west3-docker.pkg.dev/hoprassociation/docker-images/hoprd-operator:latest --platform linux/amd64 --progress plain .
docker-push: ## Deploys docker image into GCP Artifact registry
docker push europe-west3-docker.pkg.dev/hoprassociation/docker-images/hoprd-operator:latest
create-identity: ## Create identity resources
kubectl apply -f ./test-data/identity-pool.yaml
kubectl apply -f ./test-data/identity-hoprd.yaml
kubectl patch -n hoprd-operator IdentityPool pool-hoprd-operator --type='json' -p='[{"op": "replace", "path": "/spec/minReadyIdentities", "value":1}]'
kubectl patch -n rotsee IdentityPool core-rotsee --type='json' -p='[{"op": "replace", "path": "/spec/minReadyIdentities", "value":1}]'
delete-identity: ## Deletes identity resources
kubectl patch -n hoprd-operator IdentityPool pool-hoprd-operator --type='json' -p='[{"op": "replace", "path": "/spec/minReadyIdentities", "value":0}]'
kubectl patch -n rotsee IdentityPool core-rotsee --type='json' -p='[{"op": "replace", "path": "/spec/minReadyIdentities", "value":0}]'
kubectl delete -f ./test-data/identity-hoprd.yaml
kubectl apply -f ./test-data/identity-pool.yaml