Updated with folder path

This commit is contained in:
Santhosh S 2023-10-17 22:40:34 -04:00
parent 40ab868e82
commit d219faa147

View File

@ -1,22 +1,16 @@
#!/bin/bash
# Get the current working directory
current_directory="$(pwd)"
echo "Current directory: $current_directory"
# Determine the current directory (where the script is located)
script_directory="$( cd "$(dirname "$0")" ; pwd -P )"
# Navigate one folder up
#cd ..
# Get and display the new working directory
current_directory="$(pwd)"
echo "New directory: $current_directory"
# Navigate to the root of the repository
repository_root="$script_directory/.."
# Specify the relative path to the docker-compose.yml
relative_path="DamageAssesmentApi"
relative_path="DamageAssesmentApi/docker-compose.yml"
# Combine the current directory with the relative path to get the full path to docker-compose.yml
#composeFile="$current_directory/DamageAssesmentApi/docker-compose.yml"
composeFile="../DamageAssesmentApi/docker-compose.yml"
# Combine the repository root directory with the relative path to get the full path to docker-compose.yml
composeFile="$repository_root/$relative_path"
# List of services to build, tag, and push
services=(
@ -39,16 +33,8 @@ for service in "${services[@]}"; do
docker-compose -f "$composeFile" build #"$service"
# Tag the image for ACR
docker tag $service "dadeschoolscontainerregistry.azurecr.io/$service"
docker tag "$service" "dadeschoolscontainerregistry.azurecr.io/$service"
# Push the image to ACR
docker push "dadeschoolscontainerregistry.azurecr.io/$service"
done
# Get and display the current working directory
current_directory="$(pwd)"
echo "Current directory: $current_directory"
# Wait for a keypress
#echo "Press any key to continue..."
read -n 1 -s -r -p ""