From b1cca218bb6f8c01c6da6e2746c0f923cf08a1f2 Mon Sep 17 00:00:00 2001 From: dragondaddy Date: Mon, 13 Nov 2023 20:41:38 +0100 Subject: [PATCH] Only allow cron daily updates if release branch is used --- conf/daily-update.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/conf/daily-update.sh b/conf/daily-update.sh index d3953cd..ecb894f 100644 --- a/conf/daily-update.sh +++ b/conf/daily-update.sh @@ -3,7 +3,14 @@ echo " " echo "+++ $(date) +++" echo " " -echo "$(date) - Updating website..." -(cd /var/www/__APP__ ; sudo -u __APP__ util/udall) -echo "$(date) - Daily update finished." +git_branch="$(cd /var/www/__APP__ && sudo -u __APP__ \ + git branch --show-current)" 2> /dev/null +if echo $git_branch | grep -q "release" +then + echo "$(date) - Updating website..." + (cd /var/www/__APP__ ; sudo -u __APP__ util/udall) + echo "$(date) - Daily update finished." +else + echo "$(date) - release branch not in use, no automatic update" +fi