From 1f046e0c70ff8c5adf2ee2c580da166aaf237ba7 Mon Sep 17 00:00:00 2001 From: Santhosh Nair <913441@dadeschools.net> Date: Tue, 17 Oct 2023 16:37:23 +0000 Subject: [PATCH 1/3] Update azure-pipelines.yml for Azure Pipelines --- DamageAssesmentApi/azure-pipelines.yml | 57 ++++---------------------- 1 file changed, 7 insertions(+), 50 deletions(-) diff --git a/DamageAssesmentApi/azure-pipelines.yml b/DamageAssesmentApi/azure-pipelines.yml index 2e367d4..9bd1ee7 100644 --- a/DamageAssesmentApi/azure-pipelines.yml +++ b/DamageAssesmentApi/azure-pipelines.yml @@ -1,61 +1,18 @@ -name: Build & Push to ACR Pipeline - trigger: -- '*' + - '*' pr: -- '*' + - '*' pool: vmImage: 'ubuntu-latest' -jobs: -- job: BuildAndPushImages - steps: +steps: - checkout: self - - bash: | + - script: | #!/bin/bash - # Specify the path to your docker-compose.yml - composeFile="$(find $(Build.SourcesDirectory) -name docker-compose.yml | head -1)" - - # Check if a docker-compose.yml file was found - if [ -z "$composeFile" ]; then - echo "No docker-compose.yml file found in the workspace." - exit 1 - fi - - # Log the path to the docker-compose.yml file - echo "Using docker-compose file at: $composeFile" - - # Log in to ACR (replace ACR_USERNAME and ACR_PASSWORD) - docker login dadeschoolscontainerregistry.azurecr.io -u ACR_USERNAME -p ACR_PASSWORD - - # List of services to build, tag, and push - services=( - "damageassesmentapianswers" - "damageassesmentapiattachments" - "damageassesmentapiemployees" - "damageassesmentapilocations" - "damageassesmentapiquestions" - "damageassesmentapisurveys" - "damageassesmentapidoculinks" - "damageassesmentapiresponses" - ) - - # Loop through the services and build, tag, and push - for service in "${services[@]}"; do - # Build the service - docker-compose -f "$composeFile" build "$service" - - # Tag the image for ACR - docker tag "$service" "dadeschoolscontainerregistry.azurecr.io/$service" - - # Push the image to ACR - docker push "dadeschoolscontainerregistry.azurecr.io/$service" - done - displayName: 'Build and Push Docker Images' - env: - ACR_USERNAME: $(acrUsername) # Set your ACR username secret here - ACR_PASSWORD: $(acrPassword) # Set your ACR password secret here + chmod +x ./Backend-API-Services/Script/build_and_push_services2acr.sh + ./Backend-API-Services/Script/build_and_push_services2acr.sh + displayName: 'Run build_and_push_services2acr.sh' From afb520463a0276715313d75ca80e76206681fb6a Mon Sep 17 00:00:00 2001 From: Santhosh Nair <913441@dadeschools.net> Date: Tue, 17 Oct 2023 16:41:54 +0000 Subject: [PATCH 2/3] Update azure-pipelines.yml for Azure Pipelines --- DamageAssesmentApi/azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DamageAssesmentApi/azure-pipelines.yml b/DamageAssesmentApi/azure-pipelines.yml index 9bd1ee7..6778953 100644 --- a/DamageAssesmentApi/azure-pipelines.yml +++ b/DamageAssesmentApi/azure-pipelines.yml @@ -13,6 +13,6 @@ steps: - script: | #!/bin/bash - chmod +x ./Backend-API-Services/Script/build_and_push_services2acr.sh - ./Backend-API-Services/Script/build_and_push_services2acr.sh + chmod +x ./Script/build_and_push_services2acr.sh + ./Script/build_and_push_services2acr.sh displayName: 'Run build_and_push_services2acr.sh' From e8cbe7616643d2e41580a5e17c3e5c11d79a56a9 Mon Sep 17 00:00:00 2001 From: Santhosh Nair <913441@dadeschools.net> Date: Tue, 17 Oct 2023 16:44:04 +0000 Subject: [PATCH 3/3] Update azure-pipelines.yml for Azure Pipelines --- DamageAssesmentApi/azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DamageAssesmentApi/azure-pipelines.yml b/DamageAssesmentApi/azure-pipelines.yml index 6778953..bbaebd3 100644 --- a/DamageAssesmentApi/azure-pipelines.yml +++ b/DamageAssesmentApi/azure-pipelines.yml @@ -13,6 +13,6 @@ steps: - script: | #!/bin/bash - chmod +x ./Script/build_and_push_services2acr.sh - ./Script/build_and_push_services2acr.sh + chmod +x ./Scripts/build_and_push_services2acr.sh + ./Scripts/build_and_push_services2acr.sh displayName: 'Run build_and_push_services2acr.sh'