fix: Update helper image pulling logic to only pull if the version is newer
This commit is contained in:
@@ -12,7 +12,6 @@ use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\Middleware\WithoutOverlapping;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class PullHelperImageJob implements ShouldBeEncrypted, ShouldQueue
|
||||
{
|
||||
@@ -41,16 +40,11 @@ class PullHelperImageJob implements ShouldBeEncrypted, ShouldQueue
|
||||
$settings = InstanceSettings::get();
|
||||
$latest_version = data_get($versions, 'coolify.helper.version');
|
||||
$current_version = $settings->helper_version;
|
||||
Log::info('Latest version', $latest_version);
|
||||
Log::info('Current version', $current_version);
|
||||
if (version_compare($latest_version, $current_version, '>')) {
|
||||
// New version available
|
||||
Log::info('New version available', $latest_version);
|
||||
$helperImage = config('coolify.helper_image');
|
||||
// REMOVE -next
|
||||
instant_remote_process(["docker pull -q {$helperImage}:{$latest_version}-next"], $this->server);
|
||||
instant_remote_process(["docker pull -q {$helperImage}:{$latest_version}"], $this->server);
|
||||
$settings->update(['helper_version' => $latest_version]);
|
||||
Log::info('Pulled helper image', $helperImage, $latest_version);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user