From 34ac6b60e60746069a5ffae625c2883a06e359c5 Mon Sep 17 00:00:00 2001 From: thattonBL <79150422+thattonBL@users.noreply.github.com> Date: Wed, 18 Dec 2024 13:33:38 +0000 Subject: [PATCH 1/2] Update azure-pipelines.yml for Azure Pipelines Fix to use var for image when updating --- azure-pipelines.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index eb24948..7a505c4 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -13,6 +13,17 @@ steps: inputs: command: 'login' containerRegistry: 'attonbomb-DockerHub-SC' + + # Set the Azure subscription based on the branch + - script: | + echo "Determining Azure subscription..." + if [ "$(Build.SourceBranchName)" = "development" ]; then + echo "##vso[task.setvariable variable=AZURE_SUBSCRIPTION]Dev-Gateway-Resources-MS" + echo "##vso[task.setvariable variable=DOCKER_IMAGE]attonbomb/systemadmin:dev" + else + echo "##vso[task.setvariable variable=AZURE_SUBSCRIPTION]Gateway-Resources-IAC-MI-Conn-2" + fi + displayName: 'Set Azure Subscription' - task: AzureCLI@2 inputs: @@ -27,7 +38,7 @@ steps: az containerapp update \ --name gateway-global-integration-ui-iac --resource-group Gateway-IAC-Resources - --image attonbomb/systemadmin:latest + --image $(DOCKER_IMAGE) --registry-server hub.docker.com echo "Global Integration API Container App updated successfully" From 4429a83926c76449f65e03147a6b164295f8e16a Mon Sep 17 00:00:00 2001 From: thattonBL <79150422+thattonBL@users.noreply.github.com> Date: Wed, 18 Dec 2024 13:34:55 +0000 Subject: [PATCH 2/2] Update development.yaml --- .github/workflows/development.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/development.yaml b/.github/workflows/development.yaml index 4c13d6a..bed8719 100644 --- a/.github/workflows/development.yaml +++ b/.github/workflows/development.yaml @@ -27,11 +27,11 @@ jobs: # Step 3: Build the Docker image - name: Build Docker image run: | - docker build -t ${{ secrets.DOCKER_HUB_USERNAME }}/systemadmin:latest -f ./Dockerfile . + docker build -t ${{ secrets.DOCKER_HUB_USERNAME }}/systemadmin:dev -f ./Dockerfile . # Step 4: Push Docker image to Docker Hub - name: Push Docker image to Docker Hub run: | - docker push ${{ secrets.DOCKER_HUB_USERNAME }}/systemadmin:develop + docker push ${{ secrets.DOCKER_HUB_USERNAME }}/systemadmin:dev # Step 5: Trigger Azure Release Pipeline - name: Trigger Azure DevOps Pipeline uses: Azure/pipelines@v1.2