diff --git a/gitapply.sh b/gitapply.sh index e6e63c7d3..62abdb8f3 100755 --- a/gitapply.sh +++ b/gitapply.sh @@ -244,7 +244,7 @@ run_remote_update() { echo "pending" > "$status_file" ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 -o BatchMode=yes -i "$SSH_KEY" root@"$node" \ - 'cd /var/www/paymenter && git pull && npm update && npm upgrade && composer upgrade && php artisan view:clear && php artisan cache:clear && php artisan optimize && systemctl restart php8.3-fpm' \ + 'cd /var/www/paymenter && php artisan down && git pull && npm update && npm upgrade && composer upgrade && php artisan view:clear && php artisan cache:clear && php artisan optimize && systemctl restart php8.3-fpm && php artisan up' \ > "$STATUS_DIR/${node}.log" 2>&1 if [ $? -eq 0 ]; then @@ -439,6 +439,13 @@ cd /var/www/paymenter task_start "Preparing Update" countdown "$sleep_time" +# Enable Maintenance Mode +task_start "Local: Enabling Maintenance Mode" +printf " ${C3}○${NC} Putting application in maintenance mode..." +php artisan down > /dev/null 2>&1 & +spinner $! "Maintenance mode" +task_done "Maintenance mode enabled" + # Deploy with progress task_start "Deploying to Remote Nodes" printf " ${GRAY}Initiating deployment to ${#REMOTE_NODES[@]} remote nodes" @@ -560,4 +567,11 @@ done print_node_grid "Final Cluster Status" "true" "${REMOTE_NODES[@]}" +# Disable Maintenance Mode +task_start "Local: Disabling Maintenance Mode" +printf " ${C3}○${NC} Bringing application back online..." +php artisan up > /dev/null 2>&1 & +spinner $! "Bringing online" +task_done "Application is back online" + print_complete