diff --git a/Scripts/build_and_push_services2acr.ps1 b/Scripts/build_and_push_services2acr.ps1 new file mode 100644 index 0000000..d61eb0e --- /dev/null +++ b/Scripts/build_and_push_services2acr.ps1 @@ -0,0 +1,30 @@ +# powershell -ExecutionPolicy Bypass -File .\build_and_push_services2acr.ps1 +# Specify the path to your docker-compose.yml +$composeFile = "C:\Users\santh\OneDrive\Desktop\DOCKERS\ubuntu\Sprint6\C1011\Backend-API-Services\DamageAssesmentApi\docker-compose.yml" + +# List of services to build, tag, and push +$services = @( + "damageassesmentapianswers", + "damageassesmentapiattachments", + "damageassesmentapiemployees", + "damageassesmentapilocations", + "damageassesmentapiquestions", + "damageassesmentapisurveys", + "damageassesmentapidoculinks", + "damageassesmentapiresponses" +) + +# Log in to ACR (replace ACR_USERNAME and ACR_PASSWORD) +docker login dadeschoolscontainerregistry.azurecr.io -u dadeSchoolsContainerRegistry -p k1f8hE0O5hj3tYCCR/5stNrkw5BZoTmAqid/hvaVo8+ACRDc2Arn + +# Loop through the services and build, tag, and push +foreach ($service in $services) { + # 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" +} diff --git a/Scripts/build_and_push_services2acr.sh b/Scripts/build_and_push_services2acr.sh new file mode 100644 index 0000000..990902b --- /dev/null +++ b/Scripts/build_and_push_services2acr.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +# Specify the path to your docker-compose.yml +composeFile="C:/Users/santh/OneDrive/Desktop/DOCKERS/ubuntu/Sprint6/C1011/Backend-API-Services/DamageAssesmentApi/docker-compose.yml" + +# List of services to build, tag, and push +services=( + "damageassesmentapianswers" + "damageassesmentapiattachments" + "damageassesmentapiemployees" + "damageassesmentapilocations" + "damageassesmentapiquestions" + "damageassesmentapisurveys" + "damageassesmentapidoculinks" + "damageassesmentapiresponses" +) + +# Log in to ACR (replace ACR_USERNAME and ACR_PASSWORD) +docker login dadeschoolscontainerregistry.azurecr.io -u dadeSchoolsContainerRegistry -p k1f8hE0O5hj3tYCCR/5stNrkw5BZoTmAqid/hvaVo8+ACRDc2Arn + +# 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