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