2023-10-26 09:38:37 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Jobs;
|
|
|
|
|
|
|
|
|
|
use App\Models\Server;
|
|
|
|
|
use Illuminate\Bus\Queueable;
|
|
|
|
|
use Illuminate\Contracts\Queue\ShouldBeEncrypted;
|
|
|
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
|
|
|
use Illuminate\Foundation\Bus\Dispatchable;
|
|
|
|
|
use Illuminate\Queue\InteractsWithQueue;
|
|
|
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
|
|
2024-06-10 20:43:34 +00:00
|
|
|
class PullHelperImageJob implements ShouldBeEncrypted, ShouldQueue
|
2023-10-26 09:38:37 +00:00
|
|
|
{
|
|
|
|
|
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
|
|
|
|
|
|
|
|
|
public $timeout = 1000;
|
|
|
|
|
|
2024-11-22 10:16:01 +00:00
|
|
|
public function __construct(public Server $server)
|
|
|
|
|
{
|
|
|
|
|
$this->onQueue('high');
|
|
|
|
|
}
|
2024-06-10 20:43:34 +00:00
|
|
|
|
2023-10-26 09:38:37 +00:00
|
|
|
public function handle(): void
|
|
|
|
|
{
|
2024-11-12 14:18:48 +00:00
|
|
|
$helperImage = config('constants.coolify.helper_image');
|
2024-10-28 13:37:00 +00:00
|
|
|
$latest_version = instanceSettings()->helper_version;
|
|
|
|
|
instant_remote_process(["docker pull -q {$helperImage}:{$latest_version}"], $this->server, false);
|
2023-10-26 09:38:37 +00:00
|
|
|
}
|
|
|
|
|
}
|