From 161f4459a6f84b67ab95db8a76f2452beded38b7 Mon Sep 17 00:00:00 2001 From: peaklabs-dev <122374094+peaklabs-dev@users.noreply.github.com> Date: Tue, 27 Oct 2026 20:25:24 +0100 Subject: [PATCH] feat(release): let the image set the Coolify version - The upgrade script removes COOLIFY_VERSION from .env, so a tag such as nightly or pr-1234 is never taken for the version - install.sh still takes a version such as 4.6.0-beta.1, LATEST_IMAGE in .env picks the image and the image carries its version --- scripts/upgrade.sh | 2 +- tests/Unit/UpgradePostgresScriptTest.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/upgrade.sh b/scripts/upgrade.sh index e39f6378e7..af8d12c67a 100644 --- a/scripts/upgrade.sh +++ b/scripts/upgrade.sh @@ -318,7 +318,7 @@ log "All images pulled successfully" echo " All images pulled successfully." set_env_var "LATEST_IMAGE" "$LATEST_IMAGE" -set_env_var "COOLIFY_VERSION" "$LATEST_IMAGE" +sed -i '/^COOLIFY_VERSION=/d' "$ENV_FILE" log_section "Step 4/6: Stopping and restarting containers" write_status "4" "Stopping containers" diff --git a/tests/Unit/UpgradePostgresScriptTest.php b/tests/Unit/UpgradePostgresScriptTest.php index 6e0d44dd05..2821fb3b3d 100644 --- a/tests/Unit/UpgradePostgresScriptTest.php +++ b/tests/Unit/UpgradePostgresScriptTest.php @@ -57,7 +57,7 @@ it('persists the selected registry url during upgrades', function (string $path) 'stable upgrade' => 'scripts/upgrade.sh', ]); -it('persists the target image and runtime version before recreating containers', function (string $path) { +it('persists the target image and lets the image set its version before recreating containers', function (string $path) { $script = file_get_contents(getcwd().'/'.$path); if ($script === false) { throw new RuntimeException("Unable to read {$path}"); @@ -73,7 +73,7 @@ it('persists the target image and runtime version before recreating containers', }; $latestImagePosition = $position('set_env_var "LATEST_IMAGE" "$LATEST_IMAGE"'); - $coolifyVersionPosition = $position('set_env_var "COOLIFY_VERSION" "$LATEST_IMAGE"'); + $coolifyVersionPosition = $position('sed -i \'/^COOLIFY_VERSION=/d\' "$ENV_FILE"'); $imagesPulledPosition = $position('log "All images pulled successfully"'); $composeUpPosition = $position('docker compose --env-file /data/coolify/source/.env');