1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/streams_ynh.git synced 2024-09-03 20:26:20 +02:00

If release isn't current branch we git fetch it daily

This commit is contained in:
dragondaddy 2023-11-14 08:26:29 +01:00
parent 725926b354
commit 89aeb33782
2 changed files with 6 additions and 3 deletions

View file

@ -9,8 +9,9 @@ if echo $git_branch | grep -q "release"
then then
echo "$(date) - Updating website..." echo "$(date) - Updating website..."
(cd /var/www/__APP__ ; sudo -u __APP__ util/udall) (cd /var/www/__APP__ ; sudo -u __APP__ util/udall)
echo "$(date) - Daily update finished."
else 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 fi
echo "$(date) - Daily update finished."

View file

@ -72,8 +72,10 @@ set__git_branch_mode() {
if [ -z "$(cd "$install_dir" && git log --oneline release..dev)" ] if [ -z "$(cd "$install_dir" && git log --oneline release..dev)" ]
then then
# If git_branch was set to 0, switch to "release" branch # 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" 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 else
ynh_die --message="\"release\" branch is behind your local \"dev\" branch, rolling back is not allowed here" ynh_die --message="\"release\" branch is behind your local \"dev\" branch, rolling back is not allowed here"
exit 1 exit 1