Updated with folder path
This commit is contained in:
parent
40ab868e82
commit
d219faa147
@ -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=(
|
||||||
@ -36,19 +30,11 @@ docker login dadeschoolscontainerregistry.azurecr.io -u dadeSchoolsContainerRegi
|
|||||||
# Loop through the services and build, tag, and push
|
# Loop through the services and build, tag, and push
|
||||||
for service in "${services[@]}"; do
|
for service in "${services[@]}"; do
|
||||||
# Build the service
|
# Build the service
|
||||||
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 ""
|
|
||||||
|
Loading…
Reference in New Issue
Block a user