38 lines
1.2 KiB
Bash
38 lines
1.2 KiB
Bash
#!/bin/bash
|
|
|
|
# Get the current working directory
|
|
current_directory="$(pwd)"
|
|
|
|
# Specify the relative path to the docker-compose.yml
|
|
relative_path="Backend-API-Services/DamageAssesmentApi"
|
|
|
|
# Combine the current directory with the relative path to get the full path to docker-compose.yml
|
|
composeFile="$current_directory/$relative_path/docker-compose.yml"
|
|
|
|
# List of services to build, tag, and push
|
|
services=(
|
|
"damageassesment.api.answers"
|
|
"damageassesment.api.attachments"
|
|
"damageassesment.api.employees"
|
|
"damageassesment.api.locations"
|
|
"damageassesment.api.questions"
|
|
"damageassesment.api.responses"
|
|
"damageassesment.api.surveys"
|
|
"damageassesment.api.doculinks"
|
|
)
|
|
|
|
# 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
|