From cdbe615721fd634f58622474baa57901e97dfa89 Mon Sep 17 00:00:00 2001 From: Gerd Oberlechner Date: Tue, 29 Oct 2024 08:42:51 +0100 Subject: [PATCH] deploymengroup naming --- .github/workflows/aro-hcp-dev-env-cd.yml | 470 ++++++++++----------- .github/workflows/aro-hcp-dev-what-if.yml | 1 + dev-infrastructure/Makefile | 44 +- dev-infrastructure/templates/dev-acr.bicep | 2 +- dev-infrastructure/templates/region.bicep | 4 +- svc-deploy.sh | 2 + 6 files changed, 265 insertions(+), 258 deletions(-) diff --git a/.github/workflows/aro-hcp-dev-env-cd.yml b/.github/workflows/aro-hcp-dev-env-cd.yml index 0103663ee..9742c4ade 100644 --- a/.github/workflows/aro-hcp-dev-env-cd.yml +++ b/.github/workflows/aro-hcp-dev-env-cd.yml @@ -44,285 +44,285 @@ if: ${{ github.event.pull_request.head.repo.full_name != 'Azure/ARO-HCP' }} run: core.setFailed('Expected source repository to be Azure/ARO-HCP, re-create PR as a branch of Azure/ARO-HCP') - deploy_global_rg: - #if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch' - permissions: - id-token: 'write' - contents: 'read' - runs-on: 'ubuntu-latest' - steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - with: - fetch-depth: 1 + # deploy_global_rg: + # #if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch' + # permissions: + # id-token: 'write' + # contents: 'read' + # runs-on: 'ubuntu-latest' + # steps: + # - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + # with: + # fetch-depth: 1 - - name: 'Az CLI login' - uses: azure/login@6c251865b4e6290e7b78be643ea2d005bc51f69a # v2.1.1 - with: - client-id: ${{ secrets.AZURE_CLIENT_ID }} - tenant-id: ${{ secrets.AZURE_TENANT_ID }} - subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + # - name: 'Az CLI login' + # uses: azure/login@6c251865b4e6290e7b78be643ea2d005bc51f69a # v2.1.1 + # with: + # client-id: ${{ secrets.AZURE_CLIENT_ID }} + # tenant-id: ${{ secrets.AZURE_TENANT_ID }} + # subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - - name: Install Azure CLI - uses: ./.github/actions/install-azure-cli + # - name: Install Azure CLI + # uses: ./.github/actions/install-azure-cli - - name: 'Deploy' - run: | - cd dev-infrastructure/ + # - name: 'Deploy' + # run: | + # cd dev-infrastructure/ - # Manage ACR - make acr acr-svc acr-ocp + # # Manage ACR + # make acr acr-svc acr-ocp - deploy_image_sync_rg: - #if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch' - permissions: - id-token: 'write' - contents: 'read' - runs-on: 'ubuntu-latest' - steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - with: - fetch-depth: 1 + # deploy_image_sync_rg: + # #if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch' + # permissions: + # id-token: 'write' + # contents: 'read' + # runs-on: 'ubuntu-latest' + # steps: + # - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + # with: + # fetch-depth: 1 - - name: 'Az CLI login' - uses: azure/login@6c251865b4e6290e7b78be643ea2d005bc51f69a # v2.1.1 - with: - client-id: ${{ secrets.AZURE_CLIENT_ID }} - tenant-id: ${{ secrets.AZURE_TENANT_ID }} - subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + # - name: 'Az CLI login' + # uses: azure/login@6c251865b4e6290e7b78be643ea2d005bc51f69a # v2.1.1 + # with: + # client-id: ${{ secrets.AZURE_CLIENT_ID }} + # tenant-id: ${{ secrets.AZURE_TENANT_ID }} + # subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - - name: Install Azure CLI - uses: ./.github/actions/install-azure-cli + # - name: Install Azure CLI + # uses: ./.github/actions/install-azure-cli - - name: 'Deploy' - run: | - cd dev-infrastructure/ - make imagesync + # - name: 'Deploy' + # run: | + # cd dev-infrastructure/ + # make imagesync - deploy_region_rg: - #if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch' - permissions: - id-token: 'write' - contents: 'read' - runs-on: 'ubuntu-latest' - steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - with: - fetch-depth: 1 + # deploy_region_rg: + # #if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch' + # permissions: + # id-token: 'write' + # contents: 'read' + # runs-on: 'ubuntu-latest' + # steps: + # - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + # with: + # fetch-depth: 1 - - name: 'Az CLI login' - uses: azure/login@6c251865b4e6290e7b78be643ea2d005bc51f69a # v2.1.1 - with: - client-id: ${{ secrets.AZURE_CLIENT_ID }} - tenant-id: ${{ secrets.AZURE_TENANT_ID }} - subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + # - name: 'Az CLI login' + # uses: azure/login@6c251865b4e6290e7b78be643ea2d005bc51f69a # v2.1.1 + # with: + # client-id: ${{ secrets.AZURE_CLIENT_ID }} + # tenant-id: ${{ secrets.AZURE_TENANT_ID }} + # subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - - name: Install Azure CLI - uses: ./.github/actions/install-azure-cli + # - name: Install Azure CLI + # uses: ./.github/actions/install-azure-cli - - name: 'Deploy' - run: | - cd dev-infrastructure/ - make region metrics-infra + # - name: 'Deploy' + # run: | + # cd dev-infrastructure/ + # make region metrics-infra - deploy_service_cluster_rg: - #if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch' - needs: - - deploy_region_rg - permissions: - id-token: 'write' - contents: 'read' - runs-on: 'ubuntu-latest' - steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - with: - fetch-depth: 1 + # deploy_service_cluster_rg: + # #if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch' + # needs: + # - deploy_region_rg + # permissions: + # id-token: 'write' + # contents: 'read' + # runs-on: 'ubuntu-latest' + # steps: + # - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + # with: + # fetch-depth: 1 - - name: 'Az CLI login' - uses: azure/login@6c251865b4e6290e7b78be643ea2d005bc51f69a # v2.1.1 - with: - client-id: ${{ secrets.AZURE_CLIENT_ID }} - tenant-id: ${{ secrets.AZURE_TENANT_ID }} - subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + # - name: 'Az CLI login' + # uses: azure/login@6c251865b4e6290e7b78be643ea2d005bc51f69a # v2.1.1 + # with: + # client-id: ${{ secrets.AZURE_CLIENT_ID }} + # tenant-id: ${{ secrets.AZURE_TENANT_ID }} + # subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - - name: Install Azure CLI - uses: ./.github/actions/install-azure-cli + # - name: Install Azure CLI + # uses: ./.github/actions/install-azure-cli - - name: 'Deploy' - run: | - cd dev-infrastructure/ - PRINCIPAL_ID=${{ secrets.GHA_PRINCIPAL_ID }} make svc svc.aks.admin-access svc.enable-aks-metrics + # - name: 'Deploy' + # run: | + # cd dev-infrastructure/ + # PRINCIPAL_ID=${{ secrets.GHA_PRINCIPAL_ID }} make svc svc.aks.admin-access svc.enable-aks-metrics - # grant GH action user access to resources - PRINCIPAL_ID=${{ secrets.GHA_PRINCIPAL_ID }} make svc.dev-role-assignments + # # grant GH action user access to resources + # # PRINCIPAL_ID=${{ secrets.GHA_PRINCIPAL_ID }} make svc.dev-role-assignments - deploy_management_cluster_rg: - #if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch' - needs: - - deploy_region_rg - permissions: - id-token: 'write' - contents: 'read' - runs-on: 'ubuntu-latest' - steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - with: - fetch-depth: 1 + # deploy_management_cluster_rg: + # #if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch' + # needs: + # - deploy_region_rg + # permissions: + # id-token: 'write' + # contents: 'read' + # runs-on: 'ubuntu-latest' + # steps: + # - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + # with: + # fetch-depth: 1 - - name: 'Az CLI login' - uses: azure/login@6c251865b4e6290e7b78be643ea2d005bc51f69a # v2.1.1 - with: - client-id: ${{ secrets.AZURE_CLIENT_ID }} - tenant-id: ${{ secrets.AZURE_TENANT_ID }} - subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + # - name: 'Az CLI login' + # uses: azure/login@6c251865b4e6290e7b78be643ea2d005bc51f69a # v2.1.1 + # with: + # client-id: ${{ secrets.AZURE_CLIENT_ID }} + # tenant-id: ${{ secrets.AZURE_TENANT_ID }} + # subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - - name: Install Azure CLI - uses: ./.github/actions/install-azure-cli + # - name: Install Azure CLI + # uses: ./.github/actions/install-azure-cli - - name: 'Deploy or Update' - run: | - cd dev-infrastructure/ - PRINCIPAL_ID=${{ secrets.GHA_PRINCIPAL_ID }} make mgmt mgmt.aks.admin-access mgmt.enable-aks-metrics + # - name: 'Deploy or Update' + # run: | + # cd dev-infrastructure/ + # PRINCIPAL_ID=${{ secrets.GHA_PRINCIPAL_ID }} make mgmt mgmt.aks.admin-access mgmt.enable-aks-metrics - build_push_frontend: - permissions: - id-token: 'write' - contents: 'read' - runs-on: 'ubuntu-latest' - steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - with: - fetch-depth: 1 + # build_push_frontend: + # permissions: + # id-token: 'write' + # contents: 'read' + # runs-on: 'ubuntu-latest' + # steps: + # - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + # with: + # fetch-depth: 1 - - name: Install Azure CLI - uses: ./.github/actions/install-azure-cli + # - name: Install Azure CLI + # uses: ./.github/actions/install-azure-cli - - name: Build frontend container image - run: | - cd frontend/ - make image + # - name: Build frontend container image + # run: | + # cd frontend/ + # make image - - name: 'Az CLI login' - #if: github.event.pull_request.merged == true - uses: azure/login@v2 - with: - client-id: ${{ secrets.AZURE_CLIENT_ID }} - tenant-id: ${{ secrets.AZURE_TENANT_ID }} - subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + # - name: 'Az CLI login' + # #if: github.event.pull_request.merged == true + # uses: azure/login@v2 + # with: + # client-id: ${{ secrets.AZURE_CLIENT_ID }} + # tenant-id: ${{ secrets.AZURE_TENANT_ID }} + # subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - - name: Push frontend container image - if: github.event.pull_request.merged == true - run: | - cd frontend/ - make push + # - name: Push frontend container image + # if: github.event.pull_request.merged == true + # run: | + # cd frontend/ + # make push - build_push_backend: - permissions: - id-token: 'write' - contents: 'read' - runs-on: 'ubuntu-latest' - steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - with: - fetch-depth: 1 + # build_push_backend: + # permissions: + # id-token: 'write' + # contents: 'read' + # runs-on: 'ubuntu-latest' + # steps: + # - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + # with: + # fetch-depth: 1 - - name: Install Azure CLI - uses: ./.github/actions/install-azure-cli + # - name: Install Azure CLI + # uses: ./.github/actions/install-azure-cli - - name: Build backend container image - run: | - cd backend/ - make image + # - name: Build backend container image + # run: | + # cd backend/ + # make image - - name: 'Az CLI login' - #if: github.event.pull_request.merged == true - uses: azure/login@v2 - with: - client-id: ${{ secrets.AZURE_CLIENT_ID }} - tenant-id: ${{ secrets.AZURE_TENANT_ID }} - subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + # - name: 'Az CLI login' + # #if: github.event.pull_request.merged == true + # uses: azure/login@v2 + # with: + # client-id: ${{ secrets.AZURE_CLIENT_ID }} + # tenant-id: ${{ secrets.AZURE_TENANT_ID }} + # subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - - name: Push backend container image - #if: github.event.pull_request.merged == true - run: | - cd backend/ - make push + # - name: Push backend container image + # #if: github.event.pull_request.merged == true + # run: | + # cd backend/ + # make push - build_push_ocmirror: - permissions: - id-token: 'write' - contents: 'read' - needs: - - deploy_global_rg - runs-on: 'ubuntu-latest' - steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - with: - fetch-depth: 1 + # build_push_ocmirror: + # permissions: + # id-token: 'write' + # contents: 'read' + # needs: + # - deploy_global_rg + # runs-on: 'ubuntu-latest' + # steps: + # - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + # with: + # fetch-depth: 1 - - name: Install Azure CLI - uses: ./.github/actions/install-azure-cli + # - name: Install Azure CLI + # uses: ./.github/actions/install-azure-cli - - name: Build oc-mirror container image - run: | - cd image-sync/oc-mirror - make image + # - name: Build oc-mirror container image + # run: | + # cd image-sync/oc-mirror + # make image - - name: 'Az CLI login' - #if: github.event.pull_request.merged == true - uses: azure/login@v2 - with: - client-id: ${{ secrets.AZURE_CLIENT_ID }} - tenant-id: ${{ secrets.AZURE_TENANT_ID }} - subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + # - name: 'Az CLI login' + # #if: github.event.pull_request.merged == true + # uses: azure/login@v2 + # with: + # client-id: ${{ secrets.AZURE_CLIENT_ID }} + # tenant-id: ${{ secrets.AZURE_TENANT_ID }} + # subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - - name: Push oc-mirror container image - #if: github.event.pull_request.merged == true - run: | - cd image-sync/oc-mirror - make push + # - name: Push oc-mirror container image + # #if: github.event.pull_request.merged == true + # run: | + # cd image-sync/oc-mirror + # make push - build_push_imagesync: - permissions: - id-token: 'write' - contents: 'read' - needs: - - deploy_global_rg - runs-on: 'ubuntu-latest' - steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - with: - fetch-depth: 1 + # build_push_imagesync: + # permissions: + # id-token: 'write' + # contents: 'read' + # needs: + # - deploy_global_rg + # runs-on: 'ubuntu-latest' + # steps: + # - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + # with: + # fetch-depth: 1 - - name: Install Azure CLI - uses: ./.github/actions/install-azure-cli + # - name: Install Azure CLI + # uses: ./.github/actions/install-azure-cli - - name: Build image-sync container image - run: | - cd tooling/image-sync - make image + # - name: Build image-sync container image + # run: | + # cd tooling/image-sync + # make image - - name: 'Az CLI login' - #if: github.event.pull_request.merged == true - uses: azure/login@v2 - with: - client-id: ${{ secrets.AZURE_CLIENT_ID }} - tenant-id: ${{ secrets.AZURE_TENANT_ID }} - subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + # - name: 'Az CLI login' + # #if: github.event.pull_request.merged == true + # uses: azure/login@v2 + # with: + # client-id: ${{ secrets.AZURE_CLIENT_ID }} + # tenant-id: ${{ secrets.AZURE_TENANT_ID }} + # subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - - name: Push image-sync container image - #if: github.event.pull_request.merged == true - run: | - cd tooling/image-sync - make push + # - name: Push image-sync container image + # #if: github.event.pull_request.merged == true + # run: | + # cd tooling/image-sync + # make push deploy_to_service_cluster: #if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch' - needs: - - build_push_frontend - - build_push_backend - - build_push_imagesync - - build_push_ocmirror - - deploy_service_cluster_rg + # needs: + # - build_push_frontend + # - build_push_backend + # - build_push_imagesync + # - build_push_ocmirror + # - deploy_service_cluster_rg permissions: id-token: 'write' contents: 'read' diff --git a/.github/workflows/aro-hcp-dev-what-if.yml b/.github/workflows/aro-hcp-dev-what-if.yml index 703d114b7..5013b9197 100644 --- a/.github/workflows/aro-hcp-dev-what-if.yml +++ b/.github/workflows/aro-hcp-dev-what-if.yml @@ -2,6 +2,7 @@ name: ARO HCP Integrated DEV Bicep What-If env: DEPLOY_ENV: dev + DEPLOYMENT_NAME_SUFFIX: "-dev-${GITHUB_RUN_ID}" on: pull_request: branches: diff --git a/dev-infrastructure/Makefile b/dev-infrastructure/Makefile index da8538796..f90ba7051 100644 --- a/dev-infrastructure/Makefile +++ b/dev-infrastructure/Makefile @@ -11,11 +11,15 @@ endif MGMT_KUBECONFIG_FILE ?= ${HOME}/.kube/${MGMT_RESOURCEGROUP}.kubeconfig SVC_KUBECONFIG_FILE ?= ${HOME}/.kube/${SVC_RESOURCEGROUP}.kubeconfig -MGMG_RG_DEPLOYMENT_NAME ?= "mgmt" -SVC_RG_DEPLOYMENT_NAME ?= "svc" -IMAGE_SYNC_RG_DEPLOYMENT_NAME ?= "image-sync" -REGIONAL_RG_DEPLOYMENT_NAME ?= "region" -METRICS_INFRA_RG_DEPLOYMENT_NAME ?= "metrics-infra" + +DEPLOYMENT_NAME_SUFFIX ?= +GLOBAL_RG_DEPLOYMENT_NAME ?= "global${DEPLOYMENT_NAME_SUFFIX}" +MGMG_RG_DEPLOYMENT_NAME ?= "mgmt${DEPLOYMENT_NAME_SUFFIX}" +SVC_RG_DEPLOYMENT_NAME ?= "svc${DEPLOYMENT_NAME_SUFFIX}" +IMAGE_SYNC_RG_DEPLOYMENT_NAME ?= "image-sync${DEPLOYMENT_NAME_SUFFIX}" +REGIONAL_RG_DEPLOYMENT_NAME ?= "region${DEPLOYMENT_NAME_SUFFIX}" +METRICS_INFRA_RG_DEPLOYMENT_NAME ?= "metrics-infra${DEPLOYMENT_NAME_SUFFIX}" +ROLE_ASSIGNMENTS_DEPLOYMENT_NAME ?= "role-assignments${DEPLOYMENT_NAME_SUFFIX}" list: @grep '^[^#[:space:]].*:' Makefile @@ -165,7 +169,7 @@ region.clean: region.what-if: region.wait regional.rg az deployment group what-if \ - --name "region" \ + --name $(REGIONAL_RG_DEPLOYMENT_NAME) \ --resource-group $(REGIONAL_RESOURCEGROUP) \ --template-file templates/region.bicep \ --parameters \ @@ -191,7 +195,7 @@ svc.wait: svc: svc.wait svc.rg cleanup-orphaned-rolebindings az deployment group create \ - --name "svc" \ + --name $(SVC_RG_DEPLOYMENT_NAME) \ --resource-group $(SVC_RESOURCEGROUP) \ --template-file templates/svc-cluster.bicep \ $(PROMPT_TO_CONFIRM) \ @@ -229,7 +233,7 @@ svc.init: region svc svc.aks.admin-access svc.aks.kubeconfig metrics-infra svc.e svc.what-if: svc.rg az deployment group what-if \ - --name "svc" \ + --name $(SVC_RG_DEPLOYMENT_NAME) \ --resource-group $(SVC_RESOURCEGROUP) \ --template-file templates/svc-cluster.bicep \ --parameters \ @@ -237,9 +241,9 @@ svc.what-if: svc.rg .PHONY: svc.what-if svc.dev-role-assignments: - @./ensure-no-running-deployment.sh $(SVC_RESOURCEGROUP) svc-roleassigns + @./ensure-no-running-deployment.sh $(SVC_RESOURCEGROUP) ${ROLE_ASSIGNMENTS_DEPLOYMENT_NAME} az deployment group create \ - --name svc-roleassigns \ + --name ${ROLE_ASSIGNMENTS_DEPLOYMENT_NAME} \ --resource-group "${SVC_RESOURCEGROUP}" \ --template-file templates/dev-roleassignments.bicep \ --parameters configurations/dev-role-assignments.bicepparam \ @@ -309,7 +313,7 @@ mgmt.init: region mgmt mgmt.aks.admin-access mgmt.aks.kubeconfig metrics-infra m mgmt.what-if: mgmt.rg az deployment group what-if \ - --name "mgmt" \ + --name $(MGMG_RG_DEPLOYMENT_NAME) \ --resource-group $(MGMT_RESOURCEGROUP) \ --template-file templates/mgmt-cluster.bicep \ --parameters \ @@ -334,9 +338,9 @@ global.rg: .PHONY: global.rg acr: global.rg - @./ensure-no-running-deployment.sh $(GLOBAL_RESOURCEGROUP) acr + @./ensure-no-running-deployment.sh $(GLOBAL_RESOURCEGROUP) ${GLOBAL_RG_DEPLOYMENT_NAME}-acr az deployment group create \ - --name "acr" \ + --name ${GLOBAL_RG_DEPLOYMENT_NAME}-acr \ --resource-group $(GLOBAL_RESOURCEGROUP) \ --template-file templates/dev-acr.bicep \ $(PROMPT_TO_CONFIRM) \ @@ -346,7 +350,7 @@ acr: global.rg acr.what-if: global.rg az deployment group what-if \ - --name "acr" \ + --name ${GLOBAL_RG_DEPLOYMENT_NAME}-acr \ --resource-group $(GLOBAL_RESOURCEGROUP) \ --template-file templates/dev-acr.bicep \ --parameters \ @@ -354,9 +358,9 @@ acr.what-if: global.rg .PHONY: acr.what-if acr-svc: global.rg - @./ensure-no-running-deployment.sh $(GLOBAL_RESOURCEGROUP) acr-svc + @./ensure-no-running-deployment.sh $(GLOBAL_RESOURCEGROUP) ${GLOBAL_RG_DEPLOYMENT_NAME}-acr-svc az deployment group create \ - --name "acr-svc" \ + --name ${GLOBAL_RG_DEPLOYMENT_NAME}-acr-svc \ --resource-group $(GLOBAL_RESOURCEGROUP) \ --template-file templates/dev-acr.bicep \ $(PROMPT_TO_CONFIRM) \ @@ -366,7 +370,7 @@ acr-svc: global.rg acr-svc.what-if: global.rg az deployment group what-if \ - --name "acr-svc" \ + --name ${GLOBAL_RG_DEPLOYMENT_NAME}-acr-svc \ --resource-group $(GLOBAL_RESOURCEGROUP) \ --template-file templates/dev-acr.bicep \ --parameters \ @@ -374,9 +378,9 @@ acr-svc.what-if: global.rg .PHONY: acr-svc.what-if acr-ocp: global.rg - @./ensure-no-running-deployment.sh $(GLOBAL_RESOURCEGROUP) acr-ocp + @./ensure-no-running-deployment.sh $(GLOBAL_RESOURCEGROUP) ${GLOBAL_RG_DEPLOYMENT_NAME}-acr-ocp az deployment group create \ - --name "acr-ocp" \ + --name ${GLOBAL_RG_DEPLOYMENT_NAME}-acr-ocp \ --resource-group $(GLOBAL_RESOURCEGROUP) \ --template-file templates/dev-acr.bicep \ $(PROMPT_TO_CONFIRM) \ @@ -386,7 +390,7 @@ acr-ocp: global.rg acr-ocp.what-if: global.rg az deployment group what-if \ - --name "acr-ocp" \ + --name ${GLOBAL_RG_DEPLOYMENT_NAME}-acr-ocp \ --resource-group $(GLOBAL_RESOURCEGROUP) \ --template-file templates/dev-acr.bicep \ --parameters \ diff --git a/dev-infrastructure/templates/dev-acr.bicep b/dev-infrastructure/templates/dev-acr.bicep index 26e9f4286..6b6d7e24c 100644 --- a/dev-infrastructure/templates/dev-acr.bicep +++ b/dev-infrastructure/templates/dev-acr.bicep @@ -23,7 +23,7 @@ resource keyVault 'Microsoft.KeyVault/vaults@2023-07-01' existing = { } module acr '../modules/acr/acr.bicep' = { - name: acrName + name: '${deployment().name}-acrName' params: { acrName: acrName location: location diff --git a/dev-infrastructure/templates/region.bicep b/dev-infrastructure/templates/region.bicep index e7e984270..26baec1ea 100644 --- a/dev-infrastructure/templates/region.bicep +++ b/dev-infrastructure/templates/region.bicep @@ -46,7 +46,7 @@ resource regionalZone 'Microsoft.Network/dnsZones@2018-05-01' = { } module regionalZoneDelegation '../modules/dns/zone-delegation.bicep' = { - name: 'regional-zone-delegation' + name: '${deployment().name}-zone-deleg' scope: resourceGroup(baseDNSZoneResourceGroup) params: { childZoneName: regionalDNSSubdomain @@ -60,7 +60,7 @@ module regionalZoneDelegation '../modules/dns/zone-delegation.bicep' = { // module maestroInfra '../modules/maestro/maestro-infra.bicep' = { - name: 'maestro-infra' + name: '${deployment().name}-maestro' params: { eventGridNamespaceName: maestroEventGridNamespacesName location: location diff --git a/svc-deploy.sh b/svc-deploy.sh index 68b14b6af..d5cd02f08 100755 --- a/svc-deploy.sh +++ b/svc-deploy.sh @@ -17,6 +17,8 @@ if [[ "$CLUSTER" != "svc" && "$CLUSTER" != "mgmt" ]]; then fi export KUBECONFIG=$(cd dev-infrastructure ; make $CLUSTER.aks.kubeconfigfile) +echo $KUBECONFIG +cat $KUBECONFIG cd $DIR make deploy