diff --git a/.github/workflows/azure-ipam-testing.yml b/.github/workflows/azure-ipam-testing.yml index 6a161ce..fc5b328 100644 --- a/.github/workflows/azure-ipam-testing.yml +++ b/.github/workflows/azure-ipam-testing.yml @@ -69,11 +69,20 @@ jobs: - name: Update Docker-Compose YAML shell: pwsh run: | + $uiContainer = "$env:ACR_NAME.azurecr.io/ipam-ui:${{ github.run_id }}-${{ github.run_attempt }}" + $engineContainer = "$env:ACR_NAME.azurecr.io/ipam-engine:${{ github.run_id }}-${{ github.run_attempt }}" + $lbContainer = "$env:ACR_NAME.azurecr.io/ipam-lb:${{ github.run_id }}-${{ github.run_attempt }}" + $composeFile = Get-Content -Path ./docker-compose.prod.yml $composeYaml = $composeFile | ConvertFrom-Yaml - $composeYaml['services']['ipam-ui'].image = "$env:ACR_NAME.azurecr.io/ipam-ui:${{ github.run_id }}-${{ github.run_attempt }}" - $composeYaml['services']['ipam-engine'].image = "$env:ACR_NAME.azurecr.io/ipam-engine:${{ github.run_id }}-${{ github.run_attempt }}" - $composeYaml['services']['nginx-proxy'].image = "$env:ACR_NAME.azurecr.io/ipam-lb:${{ github.run_id }}-${{ github.run_attempt }}" + + $composeYaml['services']['ipam-ui'].image = $uiContainer + $composeYaml['services']['ipam-engine'].image = $engineContainer + $composeYaml['services']['nginx-proxy'].image = $lbContainer + + Get-ChildItem + $composeYaml | ConvertTo-Yaml + $composeYaml | ConvertTo-Yaml | Out-File -Path ./docker-compose-prod.yml - name: Deploy Azure IPAM @@ -177,10 +186,13 @@ jobs: run: | $tenantId = (Get-AzContext).Tenant.Id $scope = "/providers/Microsoft.Management/managementGroups/$TenantId" + $uiApp = Get-AzADApplication -ApplicationId ${{ needs.deploy.outputs.ipamUIAppId }} $engineApp = Get-AzADApplication -ApplicationId ${{ needs.deploy.outputs.ipamEngineAppId }} + Remove-AzResourceGroup -Name ${{ needs.deploy.outputs.ipamResourceGroup }} -Force Remove-AzRoleAssignment -ObjectId $engineApp.ObjectId -Scope $scope -RoleDefinitionName Reader + $uiApp | Remove-AzADApplication $engineApp | Remove-AzADApplication