diff --git a/bootstrap/helpers/shared.php b/bootstrap/helpers/shared.php index 7828bf47f..9a09adee1 100644 --- a/bootstrap/helpers/shared.php +++ b/bootstrap/helpers/shared.php @@ -1,5 +1,7 @@ getMessage()}\n"; } } + +function isAnyDeploymentInprogress() { + // Only use it in the deployment script + $count = ApplicationDeploymentQueue::whereIn('status', [ApplicationDeploymentStatus::IN_PROGRESS, ApplicationDeploymentStatus::QUEUED])->count(); + if ($count > 0) { + echo "There are $count deployments in progress. Exiting...\n"; + exit(1); + } + echo "No deployments in progress.\n"; + exit(0); +} diff --git a/scripts/cloud_upgrade.sh b/scripts/cloud_upgrade.sh new file mode 100644 index 000000000..fc1bc959a --- /dev/null +++ b/scripts/cloud_upgrade.sh @@ -0,0 +1,9 @@ +set -e +export IMAGE=$1 +docker exec coolify sh -c "php artisan tinker --execute='isAnyDeploymentInprogress()'" +docker system prune -af +docker compose pull +read -p "Press Enter to update Coolify to $IMAGE..." last_version +docker compose logs -f