From 0767fd83afbf3dc1bde3b51d49a0745a2b2918ab Mon Sep 17 00:00:00 2001 From: Vermaas <vermaas@astron.nl> Date: Tue, 10 Dec 2024 11:04:24 +0100 Subject: [PATCH] add deploy_local_dev.sh script --- deploy_local_dev.sh | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/deploy_local_dev.sh b/deploy_local_dev.sh index 07d3adba..70218ffc 100644 --- a/deploy_local_dev.sh +++ b/deploy_local_dev.sh @@ -2,10 +2,17 @@ # be in an existing git cloned atdb-ldv directory (like $HOME/my_docker/atdb-ldv) -git pull +# Pull the latest changes and capture the output +OUTPUT=$(git pull) -cd atdb -docker build -t atdb-ldv:latest . +# Check if there are any changes pulled +if [[ $OUTPUT == *"Already up to date."* ]]; then + echo "No changes detected. Skipping redeploy." +else + echo "Changes detected. Proceeding with redeploy." -cd docker -docker-compose -f docker/docker-compose-dev-local.yml -p atdb up -d \ No newline at end of file + # Proceed with build and redeploy + cd atdb + docker build -t atdb-ldv:latest . + docker-compose -f docker/docker-compose-dev-local.yml -p atdb up -d +fi \ No newline at end of file -- GitLab