From d1eac08d4678ae7ae3c382519dbe0da5e7f293e0 Mon Sep 17 00:00:00 2001 From: Andrei Kvapil Date: Thu, 15 Aug 2024 12:48:49 +0200 Subject: [PATCH] DX: Use generic Makefile for packages Signed-off-by: Andrei Kvapil --- packages/apps/bucket/Makefile | 2 ++ packages/apps/clickhouse/Makefile | 2 ++ packages/apps/ferretdb/Makefile | 2 ++ packages/apps/http-cache/Makefile | 1 + packages/apps/kafka/Makefile | 2 ++ packages/apps/kubernetes/Makefile | 1 + packages/apps/mysql/Makefile | 2 ++ packages/apps/nats/Makefile | 2 ++ packages/apps/postgres/Makefile | 2 ++ packages/apps/rabbitmq/Makefile | 2 ++ packages/apps/redis/Makefile | 2 ++ packages/apps/tcp-balancer/Makefile | 2 ++ packages/apps/tenant/Makefile | 2 ++ packages/apps/virtual-machine/Makefile | 2 ++ packages/apps/vpn/Makefile | 2 ++ packages/extra/etcd/Makefile | 4 ++++ packages/extra/ingress/Makefile | 4 ++++ packages/extra/monitoring/Makefile | 4 ++++ packages/extra/seaweedfs/Makefile | 4 ++++ packages/system/capi-operator/Makefile | 2 +- packages/system/capi-providers/Makefile | 2 +- packages/system/cert-manager-issuers/Makefile | 2 +- packages/system/cert-manager/Makefile | 2 +- packages/system/cilium/Makefile | 2 +- packages/system/clickhouse-operator/Makefile | 2 +- packages/system/dashboard/Makefile | 2 +- packages/system/etcd-operator/Makefile | 2 +- packages/system/fluxcd-operator/Makefile | 2 +- packages/system/fluxcd/Makefile | 2 +- packages/system/grafana-oncall/Makefile | 4 ++++ packages/system/grafana-operator/Makefile | 2 +- packages/system/ingress-nginx/Makefile | 5 ++--- packages/system/kafka-operator/Makefile | 2 +- packages/system/kamaji/Makefile | 2 +- packages/system/kubeovn/Makefile | 2 +- .../system/kubevirt-cdi-operator/Makefile | 2 +- packages/system/kubevirt-cdi/Makefile | 2 +- packages/system/kubevirt-operator/Makefile | 2 +- packages/system/kubevirt/Makefile | 2 +- packages/system/linstor/Makefile | 2 +- packages/system/mariadb-operator/Makefile | 2 +- packages/system/metallb/Makefile | 2 +- packages/system/monitoring/Makefile | 2 +- packages/system/nats/Makefile | 2 ++ .../system/objectstorage-controller/Makefile | 2 +- packages/system/piraeus-operator/Makefile | 2 +- packages/system/postgres-operator/Makefile | 2 +- packages/system/rabbitmq-operator/Makefile | 2 +- packages/system/redis-operator/Makefile | 2 +- packages/system/snapshot-controller/Makefile | 2 +- packages/system/telepresence/Makefile | 2 +- .../system/victoria-metrics-operator/Makefile | 2 +- scripts/{package-system.mk => package.mk} | 19 +++++++++++++------ 53 files changed, 95 insertions(+), 39 deletions(-) rename scripts/{package-system.mk => package.mk} (58%) diff --git a/packages/apps/bucket/Makefile b/packages/apps/bucket/Makefile index 207e2133..264adfcf 100644 --- a/packages/apps/bucket/Makefile +++ b/packages/apps/bucket/Makefile @@ -1,2 +1,4 @@ +include ../../../scripts/package.mk + generate: readme-generator -v values.yaml -s values.schema.json -r README.md diff --git a/packages/apps/clickhouse/Makefile b/packages/apps/clickhouse/Makefile index 207e2133..264adfcf 100644 --- a/packages/apps/clickhouse/Makefile +++ b/packages/apps/clickhouse/Makefile @@ -1,2 +1,4 @@ +include ../../../scripts/package.mk + generate: readme-generator -v values.yaml -s values.schema.json -r README.md diff --git a/packages/apps/ferretdb/Makefile b/packages/apps/ferretdb/Makefile index 207e2133..264adfcf 100644 --- a/packages/apps/ferretdb/Makefile +++ b/packages/apps/ferretdb/Makefile @@ -1,2 +1,4 @@ +include ../../../scripts/package.mk + generate: readme-generator -v values.yaml -s values.schema.json -r README.md diff --git a/packages/apps/http-cache/Makefile b/packages/apps/http-cache/Makefile index 162c3ff3..0e9965f4 100644 --- a/packages/apps/http-cache/Makefile +++ b/packages/apps/http-cache/Makefile @@ -1,6 +1,7 @@ NGINX_CACHE_TAG = v0.1.0 include ../../../scripts/common-envs.mk +include ../../../scripts/package.mk image: image-nginx diff --git a/packages/apps/kafka/Makefile b/packages/apps/kafka/Makefile index 207e2133..264adfcf 100644 --- a/packages/apps/kafka/Makefile +++ b/packages/apps/kafka/Makefile @@ -1,2 +1,4 @@ +include ../../../scripts/package.mk + generate: readme-generator -v values.yaml -s values.schema.json -r README.md diff --git a/packages/apps/kubernetes/Makefile b/packages/apps/kubernetes/Makefile index f48ba499..5c90cc15 100644 --- a/packages/apps/kubernetes/Makefile +++ b/packages/apps/kubernetes/Makefile @@ -1,6 +1,7 @@ UBUNTU_CONTAINER_DISK_TAG = v1.30.1 include ../../../scripts/common-envs.mk +include ../../../scripts/package.mk generate: readme-generator -v values.yaml -s values.schema.json -r README.md diff --git a/packages/apps/mysql/Makefile b/packages/apps/mysql/Makefile index 207e2133..264adfcf 100644 --- a/packages/apps/mysql/Makefile +++ b/packages/apps/mysql/Makefile @@ -1,2 +1,4 @@ +include ../../../scripts/package.mk + generate: readme-generator -v values.yaml -s values.schema.json -r README.md diff --git a/packages/apps/nats/Makefile b/packages/apps/nats/Makefile index 207e2133..264adfcf 100644 --- a/packages/apps/nats/Makefile +++ b/packages/apps/nats/Makefile @@ -1,2 +1,4 @@ +include ../../../scripts/package.mk + generate: readme-generator -v values.yaml -s values.schema.json -r README.md diff --git a/packages/apps/postgres/Makefile b/packages/apps/postgres/Makefile index 207e2133..264adfcf 100644 --- a/packages/apps/postgres/Makefile +++ b/packages/apps/postgres/Makefile @@ -1,2 +1,4 @@ +include ../../../scripts/package.mk + generate: readme-generator -v values.yaml -s values.schema.json -r README.md diff --git a/packages/apps/rabbitmq/Makefile b/packages/apps/rabbitmq/Makefile index 207e2133..264adfcf 100644 --- a/packages/apps/rabbitmq/Makefile +++ b/packages/apps/rabbitmq/Makefile @@ -1,2 +1,4 @@ +include ../../../scripts/package.mk + generate: readme-generator -v values.yaml -s values.schema.json -r README.md diff --git a/packages/apps/redis/Makefile b/packages/apps/redis/Makefile index 207e2133..264adfcf 100644 --- a/packages/apps/redis/Makefile +++ b/packages/apps/redis/Makefile @@ -1,2 +1,4 @@ +include ../../../scripts/package.mk + generate: readme-generator -v values.yaml -s values.schema.json -r README.md diff --git a/packages/apps/tcp-balancer/Makefile b/packages/apps/tcp-balancer/Makefile index acb3b034..3889a17a 100644 --- a/packages/apps/tcp-balancer/Makefile +++ b/packages/apps/tcp-balancer/Makefile @@ -1,3 +1,5 @@ +include ../../../scripts/package.mk + generate: readme-generator -v values.yaml -s values.schema.json.tmp -r README.md cat values.schema.json.tmp | jq '.properties.httpAndHttps.properties.mode.enum = ["tcp","tcp-with-proxy"]' > values.schema.json diff --git a/packages/apps/tenant/Makefile b/packages/apps/tenant/Makefile index 207e2133..264adfcf 100644 --- a/packages/apps/tenant/Makefile +++ b/packages/apps/tenant/Makefile @@ -1,2 +1,4 @@ +include ../../../scripts/package.mk + generate: readme-generator -v values.yaml -s values.schema.json -r README.md diff --git a/packages/apps/virtual-machine/Makefile b/packages/apps/virtual-machine/Makefile index ee879e83..12b42be0 100644 --- a/packages/apps/virtual-machine/Makefile +++ b/packages/apps/virtual-machine/Makefile @@ -1,3 +1,5 @@ +include ../../../scripts/package.mk + generate: readme-generator -v values.yaml -s values.schema.json.tmp -r README.md cat values.schema.json.tmp | \ diff --git a/packages/apps/vpn/Makefile b/packages/apps/vpn/Makefile index 207e2133..264adfcf 100644 --- a/packages/apps/vpn/Makefile +++ b/packages/apps/vpn/Makefile @@ -1,2 +1,4 @@ +include ../../../scripts/package.mk + generate: readme-generator -v values.yaml -s values.schema.json -r README.md diff --git a/packages/extra/etcd/Makefile b/packages/extra/etcd/Makefile index 207e2133..1c503d6b 100644 --- a/packages/extra/etcd/Makefile +++ b/packages/extra/etcd/Makefile @@ -1,2 +1,6 @@ +NAME=etcd + +include ../../../scripts/package.mk + generate: readme-generator -v values.yaml -s values.schema.json -r README.md diff --git a/packages/extra/ingress/Makefile b/packages/extra/ingress/Makefile index ae3389f5..a1de94f4 100644 --- a/packages/extra/ingress/Makefile +++ b/packages/extra/ingress/Makefile @@ -1,3 +1,7 @@ +NAME=ingress + +include ../../../scripts/package.mk + update: get-cloudflare-ips get-cloudflare-ips: diff --git a/packages/extra/monitoring/Makefile b/packages/extra/monitoring/Makefile index f9da9796..38796029 100644 --- a/packages/extra/monitoring/Makefile +++ b/packages/extra/monitoring/Makefile @@ -1,3 +1,7 @@ +NAME=monitoring + +include ../../../scripts/package.mk + generate: readme-generator -v values.yaml -s values.schema.json.tmp -r README.md cat values.schema.json.tmp | \ diff --git a/packages/extra/seaweedfs/Makefile b/packages/extra/seaweedfs/Makefile index 207e2133..bc02a298 100644 --- a/packages/extra/seaweedfs/Makefile +++ b/packages/extra/seaweedfs/Makefile @@ -1,2 +1,6 @@ +NAME=seaweedfs + +include ../../../scripts/package.mk + generate: readme-generator -v values.yaml -s values.schema.json -r README.md diff --git a/packages/system/capi-operator/Makefile b/packages/system/capi-operator/Makefile index 2fd794d3..baa4a5fc 100644 --- a/packages/system/capi-operator/Makefile +++ b/packages/system/capi-operator/Makefile @@ -1,7 +1,7 @@ export NAME=capi-operator export NAMESPACE=cozy-cluster-api -include ../../../scripts/package-system.mk +include ../../../scripts/package.mk update: rm -rf charts diff --git a/packages/system/capi-providers/Makefile b/packages/system/capi-providers/Makefile index 6e8d7868..249d3f38 100644 --- a/packages/system/capi-providers/Makefile +++ b/packages/system/capi-providers/Makefile @@ -1,4 +1,4 @@ export NAME=capi-providers export NAMESPACE=cozy-cluster-api -include ../../../scripts/package-system.mk +include ../../../scripts/package.mk diff --git a/packages/system/cert-manager-issuers/Makefile b/packages/system/cert-manager-issuers/Makefile index 7c01ba56..a7a6ce10 100644 --- a/packages/system/cert-manager-issuers/Makefile +++ b/packages/system/cert-manager-issuers/Makefile @@ -1,4 +1,4 @@ export NAME=cert-manager-issuers export NAMESPACE=cozy-cert-manager -include ../../../scripts/package-system.mk +include ../../../scripts/package.mk diff --git a/packages/system/cert-manager/Makefile b/packages/system/cert-manager/Makefile index 929b160a..d48ad5be 100644 --- a/packages/system/cert-manager/Makefile +++ b/packages/system/cert-manager/Makefile @@ -1,7 +1,7 @@ export NAME=cert-manager export NAMESPACE=cozy-$(NAME) -include ../../../scripts/package-system.mk +include ../../../scripts/package.mk update: rm -rf charts diff --git a/packages/system/cilium/Makefile b/packages/system/cilium/Makefile index b19c48c8..eff6027a 100644 --- a/packages/system/cilium/Makefile +++ b/packages/system/cilium/Makefile @@ -4,7 +4,7 @@ export NAME=cilium export NAMESPACE=cozy-$(NAME) include ../../../scripts/common-envs.mk -include ../../../scripts/package-system.mk +include ../../../scripts/package.mk update: rm -rf charts diff --git a/packages/system/clickhouse-operator/Makefile b/packages/system/clickhouse-operator/Makefile index 64447cca..e821b664 100644 --- a/packages/system/clickhouse-operator/Makefile +++ b/packages/system/clickhouse-operator/Makefile @@ -1,7 +1,7 @@ export NAME=clickhouse-operator export NAMESPACE=cozy-clickhouse-operator -include ../../../scripts/package-system.mk +include ../../../scripts/package.mk update: rm -rf charts diff --git a/packages/system/dashboard/Makefile b/packages/system/dashboard/Makefile index 7ddeb4a8..e62c39f9 100644 --- a/packages/system/dashboard/Makefile +++ b/packages/system/dashboard/Makefile @@ -2,7 +2,7 @@ export NAME=dashboard export NAMESPACE=cozy-$(NAME) include ../../../scripts/common-envs.mk -include ../../../scripts/package-system.mk +include ../../../scripts/package.mk update: update-chart update-dockerfiles image: image-dashboard image-kubeapps-apis diff --git a/packages/system/etcd-operator/Makefile b/packages/system/etcd-operator/Makefile index 5c0dee74..a2154952 100644 --- a/packages/system/etcd-operator/Makefile +++ b/packages/system/etcd-operator/Makefile @@ -1,7 +1,7 @@ export NAME=etcd-operator export NAMESPACE=cozy-${NAME} -include ../../../scripts/package-system.mk +include ../../../scripts/package.mk update: rm -rf charts diff --git a/packages/system/fluxcd-operator/Makefile b/packages/system/fluxcd-operator/Makefile index 26cf39a7..f91c1c7f 100644 --- a/packages/system/fluxcd-operator/Makefile +++ b/packages/system/fluxcd-operator/Makefile @@ -1,7 +1,7 @@ NAME=fluxcd-operator NAMESPACE=cozy-fluxcd -include ../../../scripts/package-system.mk +include ../../../scripts/package.mk apply-locally: helm upgrade -i -n $(NAMESPACE) $(NAME) . diff --git a/packages/system/fluxcd/Makefile b/packages/system/fluxcd/Makefile index de09740c..2aca5f05 100644 --- a/packages/system/fluxcd/Makefile +++ b/packages/system/fluxcd/Makefile @@ -4,4 +4,4 @@ NAMESPACE=cozy-$(NAME) apply-locally: helm upgrade -i -n $(NAMESPACE) $(NAME) . -include ../../../scripts/package-system.mk +include ../../../scripts/package.mk diff --git a/packages/system/grafana-oncall/Makefile b/packages/system/grafana-oncall/Makefile index 033be23a..096e34a8 100644 --- a/packages/system/grafana-oncall/Makefile +++ b/packages/system/grafana-oncall/Makefile @@ -1,3 +1,7 @@ +NAME=grafana-oncall-system + +include ../../../scripts/package.mk + update: rm -rf charts helm repo add grafana https://grafana.github.io/helm-charts diff --git a/packages/system/grafana-operator/Makefile b/packages/system/grafana-operator/Makefile index 38eed61c..82c734d4 100644 --- a/packages/system/grafana-operator/Makefile +++ b/packages/system/grafana-operator/Makefile @@ -1,7 +1,7 @@ export NAME=grafana-operator export NAMESPACE=cozy-grafana-operator -include ../../../scripts/package-system.mk +include ../../../scripts/package.mk update: rm -rf charts diff --git a/packages/system/ingress-nginx/Makefile b/packages/system/ingress-nginx/Makefile index a6b85f48..9ad10ae1 100644 --- a/packages/system/ingress-nginx/Makefile +++ b/packages/system/ingress-nginx/Makefile @@ -1,7 +1,6 @@ -export NAME=ingress-nginx -export NAMESPACE=cozy-$(NAME) +NAME=ingress-nginx-system -include ../../../scripts/package-system.mk +include ../../../scripts/package.mk update: rm -rf charts diff --git a/packages/system/kafka-operator/Makefile b/packages/system/kafka-operator/Makefile index 29c32688..72e6e127 100644 --- a/packages/system/kafka-operator/Makefile +++ b/packages/system/kafka-operator/Makefile @@ -1,7 +1,7 @@ export NAME=kafka-operator export NAMESPACE=cozy-$(NAME) -include ../../../scripts/package-system.mk +include ../../../scripts/package.mk update: rm -rf charts diff --git a/packages/system/kamaji/Makefile b/packages/system/kamaji/Makefile index 7968b577..323ab704 100644 --- a/packages/system/kamaji/Makefile +++ b/packages/system/kamaji/Makefile @@ -2,7 +2,7 @@ export NAME=kamaji export NAMESPACE=cozy-$(NAME) include ../../../scripts/common-envs.mk -include ../../../scripts/package-system.mk +include ../../../scripts/package.mk update: rm -rf charts diff --git a/packages/system/kubeovn/Makefile b/packages/system/kubeovn/Makefile index 0f8b997c..158cc35c 100644 --- a/packages/system/kubeovn/Makefile +++ b/packages/system/kubeovn/Makefile @@ -4,7 +4,7 @@ export NAME=kubeovn export NAMESPACE=cozy-$(NAME) include ../../../scripts/common-envs.mk -include ../../../scripts/package-system.mk +include ../../../scripts/package.mk update: rm -rf charts && mkdir -p charts/kube-ovn diff --git a/packages/system/kubevirt-cdi-operator/Makefile b/packages/system/kubevirt-cdi-operator/Makefile index 6cf08193..7022599f 100644 --- a/packages/system/kubevirt-cdi-operator/Makefile +++ b/packages/system/kubevirt-cdi-operator/Makefile @@ -1,7 +1,7 @@ export NAME=kubevirt-cdi-operator export NAMESPACE=cozy-kubevirt-cdi -include ../../../scripts/package-system.mk +include ../../../scripts/package.mk update: rm -rf templates diff --git a/packages/system/kubevirt-cdi/Makefile b/packages/system/kubevirt-cdi/Makefile index c6209a54..0b3791a1 100644 --- a/packages/system/kubevirt-cdi/Makefile +++ b/packages/system/kubevirt-cdi/Makefile @@ -1,7 +1,7 @@ export NAME=kubevirt-cdi export NAMESPACE=cozy-$(NAME) -include ../../../scripts/package-system.mk +include ../../../scripts/package.mk update: rm -rf templates diff --git a/packages/system/kubevirt-operator/Makefile b/packages/system/kubevirt-operator/Makefile index cea1a529..42bf80a7 100644 --- a/packages/system/kubevirt-operator/Makefile +++ b/packages/system/kubevirt-operator/Makefile @@ -1,7 +1,7 @@ export NAME=kubevirt-operator export NAMESPACE=cozy-kubevirt -include ../../../scripts/package-system.mk +include ../../../scripts/package.mk update: rm -rf templates diff --git a/packages/system/kubevirt/Makefile b/packages/system/kubevirt/Makefile index e939b0f1..2c2e57ab 100644 --- a/packages/system/kubevirt/Makefile +++ b/packages/system/kubevirt/Makefile @@ -1,7 +1,7 @@ export NAME=kubevirt export NAMESPACE=cozy-$(NAME) -include ../../../scripts/package-system.mk +include ../../../scripts/package.mk update: rm -rf templates diff --git a/packages/system/linstor/Makefile b/packages/system/linstor/Makefile index 34e8cd9c..5de22194 100644 --- a/packages/system/linstor/Makefile +++ b/packages/system/linstor/Makefile @@ -1,4 +1,4 @@ export NAME=linstor export NAMESPACE=cozy-$(NAME) -include ../../../scripts/package-system.mk +include ../../../scripts/package.mk diff --git a/packages/system/mariadb-operator/Makefile b/packages/system/mariadb-operator/Makefile index a94e4306..ecbd51d9 100644 --- a/packages/system/mariadb-operator/Makefile +++ b/packages/system/mariadb-operator/Makefile @@ -1,7 +1,7 @@ export NAME=mariadb-operator export NAMESPACE=cozy-$(NAME) -include ../../../scripts/package-system.mk +include ../../../scripts/package.mk update: rm -rf charts diff --git a/packages/system/metallb/Makefile b/packages/system/metallb/Makefile index 09085f4e..56fdee1e 100644 --- a/packages/system/metallb/Makefile +++ b/packages/system/metallb/Makefile @@ -1,7 +1,7 @@ export NAME=metallb export NAMESPACE=cozy-$(NAME) -include ../../../scripts/package-system.mk +include ../../../scripts/package.mk update: rm -rf charts diff --git a/packages/system/monitoring/Makefile b/packages/system/monitoring/Makefile index bfc68669..cfd2701a 100644 --- a/packages/system/monitoring/Makefile +++ b/packages/system/monitoring/Makefile @@ -1,7 +1,7 @@ export NAME=monitoring export NAMESPACE=cozy-$(NAME) -include ../../../scripts/package-system.mk +include ../../../scripts/package.mk update: rm -rf charts diff --git a/packages/system/nats/Makefile b/packages/system/nats/Makefile index 738b387d..25657a89 100644 --- a/packages/system/nats/Makefile +++ b/packages/system/nats/Makefile @@ -1,3 +1,5 @@ +include ../../../scripts/package.mk + update: rm -rf charts helm repo add nats https://nats-io.github.io/k8s/helm/charts/ diff --git a/packages/system/objectstorage-controller/Makefile b/packages/system/objectstorage-controller/Makefile index 784f46c2..66c9e2d9 100644 --- a/packages/system/objectstorage-controller/Makefile +++ b/packages/system/objectstorage-controller/Makefile @@ -1,7 +1,7 @@ export NAME=cosi-controller export NAMESPACE=cozy-$(NAME) -include ../../../scripts/package-system.mk +include ../../../scripts/package.mk update: rm -rf templates diff --git a/packages/system/piraeus-operator/Makefile b/packages/system/piraeus-operator/Makefile index ae459844..a10c7369 100644 --- a/packages/system/piraeus-operator/Makefile +++ b/packages/system/piraeus-operator/Makefile @@ -1,7 +1,7 @@ export NAME=piraeus-operator export NAMESPACE=cozy-linstor -include ../../../scripts/package-system.mk +include ../../../scripts/package.mk update: rm -rf charts diff --git a/packages/system/postgres-operator/Makefile b/packages/system/postgres-operator/Makefile index 037948fc..ad123fe2 100644 --- a/packages/system/postgres-operator/Makefile +++ b/packages/system/postgres-operator/Makefile @@ -1,7 +1,7 @@ export NAME=postgres-operator export NAMESPACE=cozy-$(NAME) -include ../../../scripts/package-system.mk +include ../../../scripts/package.mk update: rm -rf charts diff --git a/packages/system/rabbitmq-operator/Makefile b/packages/system/rabbitmq-operator/Makefile index 999958c0..233cc3d9 100644 --- a/packages/system/rabbitmq-operator/Makefile +++ b/packages/system/rabbitmq-operator/Makefile @@ -1,7 +1,7 @@ export NAME=rabbitmq-operator export NAMESPACE=cozy-$(NAME) -include ../../../scripts/package-system.mk +include ../../../scripts/package.mk update: rm -rf templates/cluster-operator.yml diff --git a/packages/system/redis-operator/Makefile b/packages/system/redis-operator/Makefile index 28007838..9ea964dd 100644 --- a/packages/system/redis-operator/Makefile +++ b/packages/system/redis-operator/Makefile @@ -1,7 +1,7 @@ export NAME=redis-operator export NAMESPACE=cozy-$(NAME) -include ../../../scripts/package-system.mk +include ../../../scripts/package.mk update: rm -rf charts diff --git a/packages/system/snapshot-controller/Makefile b/packages/system/snapshot-controller/Makefile index d06f8967..65d37f1f 100644 --- a/packages/system/snapshot-controller/Makefile +++ b/packages/system/snapshot-controller/Makefile @@ -1,7 +1,7 @@ export NAME=snapshot-controller export NAMESPACE=cozy-$(NAME) -include ../../../scripts/package-system.mk +include ../../../scripts/package.mk update: rm -rf charts diff --git a/packages/system/telepresence/Makefile b/packages/system/telepresence/Makefile index 31de4820..1aec8917 100644 --- a/packages/system/telepresence/Makefile +++ b/packages/system/telepresence/Makefile @@ -1,7 +1,7 @@ export NAME=traffic-manager export NAMESPACE=cozy-telepresence -include ../../../scripts/package-system.mk +include ../../../scripts/package.mk update: rm -rf charts diff --git a/packages/system/victoria-metrics-operator/Makefile b/packages/system/victoria-metrics-operator/Makefile index 5221bfae..98619f3b 100644 --- a/packages/system/victoria-metrics-operator/Makefile +++ b/packages/system/victoria-metrics-operator/Makefile @@ -1,7 +1,7 @@ export NAME=victoria-metrics-operator export NAMESPACE=cozy-$(NAME) -include ../../../scripts/package-system.mk +include ../../../scripts/package.mk update: rm -rf charts diff --git a/scripts/package-system.mk b/scripts/package.mk similarity index 58% rename from scripts/package-system.mk rename to scripts/package.mk index 37d12fe3..4188e771 100644 --- a/scripts/package-system.mk +++ b/scripts/package.mk @@ -4,20 +4,27 @@ help: ## Show this help. @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {sub("\\\\n",sprintf("\n%22c"," "), $$2);printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) -show: ## Show output of rendered templates +show: check ## Show output of rendered templates kubectl get hr -n $(NAMESPACE) $(NAME) -o jsonpath='{.spec.values}' | NAMESPACE=$(NAMESPACE) NAME=$(NAME) \ helm template --dry-run=server --post-renderer ../../../scripts/fluxcd-kustomize.sh -n $(NAMESPACE) $(NAME) . -f - -apply: suspend ## Apply Helm release to a Kubernetes cluster +apply: check suspend ## Apply Helm release to a Kubernetes cluster kubectl get hr -n $(NAMESPACE) $(NAME) -o jsonpath='{.spec.values}' | NAMESPACE=$(NAMESPACE) NAME=$(NAME) \ helm upgrade -i --post-renderer ../../../scripts/fluxcd-kustomize.sh -n $(NAMESPACE) $(NAME) . -f - -diff: ## Diff Helm release against objects in a Kubernetes cluster +diff: check ## Diff Helm release against objects in a Kubernetes cluster kubectl get hr -n $(NAMESPACE) $(NAME) -o jsonpath='{.spec.values}' | NAMESPACE=$(NAMESPACE) NAME=$(NAME) \ - helm diff upgrade --allow-unreleased --post-renderer ../../../scripts/fluxcd-kustomize.sh -n $(NAMESPACE) $(NAME) . -f - + helm diff upgrade --show-secrets --allow-unreleased --post-renderer ../../../scripts/fluxcd-kustomize.sh -n $(NAMESPACE) $(NAME) . -f - -suspend: ## Suspend reconciliation for an existing Helm release +suspend: check ## Suspend reconciliation for an existing Helm release kubectl patch hr -n $(NAMESPACE) $(NAME) -p '{"spec": {"suspend": true}}' --type=merge --field-manager=flux-client-side-apply -resume: ## Resume reconciliation for an existing Helm release +resume: check ## Resume reconciliation for an existing Helm release kubectl patch hr -n $(NAMESPACE) $(NAME) -p '{"spec": {"suspend": null}}' --type=merge --field-manager=flux-client-side-apply + +delete: check suspend ## Delete Helm release from a Kubernetes cluster + helm uninstall -n $(NAMESPACE) $(NAME) + +check: + @if [ -z "$(NAME)" ]; then echo "env NAME is not set!" >&2; exit 1; fi + @if [ -z "$(NAMESPACE)" ]; then echo "env NAMESPACE is not set!" >&2; exit 1; fi