From 88dff3b792fed70cde0188af6cf02fb951b784c0 Mon Sep 17 00:00:00 2001 From: Gerd Oberlechner Date: Fri, 25 Oct 2024 12:45:20 +0200 Subject: [PATCH] cleanup deploy scripts Signed-off-by: Gerd Oberlechner --- Makefile | 16 ++++++++-------- backend/rollout | 9 --------- cluster-service/rollout | 11 ----------- dev-infrastructure/Makefile | 23 ++++++++++++++++------- frontend/rollout | 9 --------- maestro/agent/rollout | 11 ----------- maestro/registration/rollout | 11 ----------- maestro/server/rollout | 11 ----------- svc-deploy | 13 +++++++++++++ 9 files changed, 37 insertions(+), 77 deletions(-) delete mode 100755 backend/rollout delete mode 100755 cluster-service/rollout delete mode 100755 frontend/rollout delete mode 100755 maestro/agent/rollout delete mode 100755 maestro/registration/rollout delete mode 100755 maestro/server/rollout create mode 100755 svc-deploy diff --git a/Makefile b/Makefile index f9cfe2ed2..4472899b0 100644 --- a/Makefile +++ b/Makefile @@ -61,20 +61,20 @@ infra.clean: # cs.deploy: - cluster-service/rollout $(DEPLOY_ENV) + ./svc-deploy $(DEPLOY_ENV) cluster-service svc # # Maestro # maestro.server.deploy: - maestro/server/rollout $(DEPLOY_ENV) + ./svc-deploy $(DEPLOY_ENV) maestro/server svc maestro.agent.deploy: - maestro/agent/rollout $(DEPLOY_ENV) + ./svc-deploy $(DEPLOY_ENV) maestro/agent mgmt maestro.registration.deploy: - maestro/registration/rollout $(DEPLOY_ENV) + ./svc-deploy $(DEPLOY_ENV) maestro/registration mgmt maestro: maestro.server.deploy maestro.agent.deploy maestro.registration.deploy @@ -83,24 +83,24 @@ maestro: maestro.server.deploy maestro.agent.deploy maestro.registration.deploy # rp.frontend.deploy: - frontend/rollout $(DEPLOY_ENV) + ./svc-deploy $(DEPLOY_ENV) frontend svc rp.backend.deploy: - backend/rollout $(DEPLOY_ENV) + ./svc-deploy $(DEPLOY_ENV) backend svc # # ACM # acm.deploy: - acm/rollout $(DEPLOY_ENV) + ./svc-deploy $(DEPLOY_ENV) acm svc # # Hypershift # hypershift.deploy: - hypershift/rollout $(DEPLOY_ENV) + ./svc-deploy $(DEPLOY_ENV) hypershift svc # # Deploy ALL components diff --git a/backend/rollout b/backend/rollout deleted file mode 100755 index 7e36a7f7f..000000000 --- a/backend/rollout +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -set -e - -DEPLOY_ENV=$1 -./generate-makefile $DEPLOY_ENV - -export KUBECONFIG=$(../dev-infrastructure/make $DEPLOY_ENV svc.aks.kubeconfig) -make deploy diff --git a/cluster-service/rollout b/cluster-service/rollout deleted file mode 100755 index 67cbb4ec9..000000000 --- a/cluster-service/rollout +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -set -e - -DEPLOY_ENV=$1 -cd $(dirname "$(realpath "${BASH_SOURCE[0]}")") - -../templatize $DEPLOY_ENV Makefile.tmpl.mk Makefile - -export KUBECONFIG=$(../dev-infrastructure/make $DEPLOY_ENV svc.aks.kubeconfig) -make deploy diff --git a/dev-infrastructure/Makefile b/dev-infrastructure/Makefile index e46d3db00..33780cfde 100644 --- a/dev-infrastructure/Makefile +++ b/dev-infrastructure/Makefile @@ -8,6 +8,9 @@ ifndef SKIP_CONFIRM PROMPT_TO_CONFIRM = "--confirm-with-what-if" endif +MGMT_KUBECONFIG_FILE ?= ${HOME}/.kube/${MGMT_RESOURCEGROUP}.kubeconfig +SVC_KUBECONFIG_FILE ?= ${HOME}/.kube/${SVC_RESOURCEGROUP}.kubeconfig + list: @grep '^[^#[:space:]].*:' Makefile .PHONY: list @@ -175,11 +178,14 @@ svc.aks.admin-access: .PHONY: svc.aks.admin-access svc.aks.kubeconfig: - @az aks get-credentials --overwrite-existing --only-show-errors -n ${AKS_NAME} -g $(SVC_RESOURCEGROUP) -f "${HOME}/.kube/${SVC_RESOURCEGROUP}.kubeconfig" - @kubelogin convert-kubeconfig -l azurecli --kubeconfig "${HOME}/.kube/${SVC_RESOURCEGROUP}.kubeconfig" - @echo ${HOME}/.kube/${SVC_RESOURCEGROUP}.kubeconfig + @az aks get-credentials --overwrite-existing --only-show-errors -n ${AKS_NAME} -g $(SVC_RESOURCEGROUP) -f "${SVC_KUBECONFIG_FILE}" + @kubelogin convert-kubeconfig -l azurecli --kubeconfig "${SVC_KUBECONFIG_FILE}" .PHONY: svc.aks.kubeconfig +svc.aks.kubeconfigfile: + @echo ${SVC_KUBECONFIG_FILE} +.PHONY: svc.aks.kubeconfigfile + svc.init: svc svc.aks.admin-access svc.aks.kubeconfig svc.enable-aks-metrics .PHONY: svc.init @@ -237,12 +243,15 @@ mgmt.aks.admin-access: @scripts/aks-admin-access.sh $(MGMT_RESOURCEGROUP) .PHONY: mgmt.aks.admin-access -mgmt.aks.kubeconfig: - @az aks get-credentials --overwrite-existing --only-show-errors -n ${AKS_NAME} -g $(MGMT_RESOURCEGROUP) -f "${HOME}/.kube/${MGMT_RESOURCEGROUP}.kubeconfig" - @kubelogin convert-kubeconfig -l azurecli --kubeconfig "${HOME}/.kube/${MGMT_RESOURCEGROUP}.kubeconfig" - @echo ${HOME}/.kube/${MGMT_RESOURCEGROUP}.kubeconfig +mgmt.aks.kubeconfig: mgmt.aks.kubeconfigfile + @az aks get-credentials --overwrite-existing --only-show-errors -n ${AKS_NAME} -g $(MGMT_RESOURCEGROUP) -f "${MGMT_KUBECONFIG_FILE}" + @kubelogin convert-kubeconfig -l azurecli --kubeconfig "${MGMT_KUBECONFIG_FILE}" .PHONY: mgmt.aks.kubeconfig +mgmt.aks.kubeconfigfile: + @echo ${MGMT_KUBECONFIG_FILE} +.PHONY: mgmt.aks.kubeconfigfile + mgmt.init: mgmt mgmt.aks.admin-access mgmt.aks.kubeconfig mgmt.enable-aks-metrics .PHONY: mgmt.init diff --git a/frontend/rollout b/frontend/rollout deleted file mode 100755 index 7e36a7f7f..000000000 --- a/frontend/rollout +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -set -e - -DEPLOY_ENV=$1 -./generate-makefile $DEPLOY_ENV - -export KUBECONFIG=$(../dev-infrastructure/make $DEPLOY_ENV svc.aks.kubeconfig) -make deploy diff --git a/maestro/agent/rollout b/maestro/agent/rollout deleted file mode 100755 index 134075900..000000000 --- a/maestro/agent/rollout +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -set -e - -DEPLOY_ENV=$1 -cd $(dirname "$(realpath "${BASH_SOURCE[0]}")") - -../../templatize $DEPLOY_ENV Makefile.tmpl.mk Makefile - -export KUBECONFIG=$(../../dev-infrastructure/make $DEPLOY_ENV mgmt.aks.kubeconfig) -make deploy diff --git a/maestro/registration/rollout b/maestro/registration/rollout deleted file mode 100755 index d2266e71c..000000000 --- a/maestro/registration/rollout +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -set -e - -DEPLOY_ENV=$1 -cd $(dirname "$(realpath "${BASH_SOURCE[0]}")") - -../../templatize $DEPLOY_ENV Makefile.tmpl.mk Makefile - -export KUBECONFIG=$(../../dev-infrastructure/make $DEPLOY_ENV svc.aks.kubeconfig) -make deploy diff --git a/maestro/server/rollout b/maestro/server/rollout deleted file mode 100755 index d2266e71c..000000000 --- a/maestro/server/rollout +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -set -e - -DEPLOY_ENV=$1 -cd $(dirname "$(realpath "${BASH_SOURCE[0]}")") - -../../templatize $DEPLOY_ENV Makefile.tmpl.mk Makefile - -export KUBECONFIG=$(../../dev-infrastructure/make $DEPLOY_ENV svc.aks.kubeconfig) -make deploy diff --git a/svc-deploy b/svc-deploy new file mode 100755 index 000000000..8962985d8 --- /dev/null +++ b/svc-deploy @@ -0,0 +1,13 @@ +#!/bin/bash + +cd $(dirname "$(realpath "${BASH_SOURCE[0]}")") + +export DEPLOY_ENV=$1 +export DIR=$2 +export CLUSTER=$3 +export KUBECONFIG=$(./dev-infrastructure/make $DEPLOY_ENV $CLUSTER.aks.kubeconfigfile) + +./templatize $DEPLOY_ENV $DIR/Makefile.tmpl.mk $DIR/Makefile + +cd $DIR +make deploy