From 89aeb3378281c0d942d4aeeb1c9aa00758c95a49 Mon Sep 17 00:00:00 2001 From: dragondaddy Date: Tue, 14 Nov 2023 08:26:29 +0100 Subject: [PATCH] If release isn't current branch we git fetch it daily --- conf/daily-update.sh | 5 +++-- scripts/config | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/conf/daily-update.sh b/conf/daily-update.sh index ecb894f..fff1714 100644 --- a/conf/daily-update.sh +++ b/conf/daily-update.sh @@ -9,8 +9,9 @@ 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" + echo "$(date) - Updating release branch code..." + (cd /var/www/__APP__ ; sudo -u __APP__ git fetch origin release:release) fi +echo "$(date) - Daily update finished." diff --git a/scripts/config b/scripts/config index 61bd5e1..457c906 100644 --- a/scripts/config +++ b/scripts/config @@ -72,8 +72,10 @@ set__git_branch_mode() { if [ -z "$(cd "$install_dir" && git log --oneline release..dev)" ] then # If git_branch was set to 0, switch to "release" branch - (cd "$install_dir" && ynh_exec_as "$app" git checkout release) ynh_print_info "Switching to \"release\" branch" + (cd "$install_dir" && ynh_exec_as "$app" git checkout release) + ynh_print_info "Full update of \"release\" branch" + (cd "$install_dir" && ynh_exec_as "$app" util/udall) else ynh_die --message="\"release\" branch is behind your local \"dev\" branch, rolling back is not allowed here" exit 1