Initial Ladill Hosting app with Gitea deploy pipeline.
Deploy Ladill Hosting / deploy (push) Failing after 17s
Deploy Ladill Hosting / deploy (push) Failing after 17s
Shared web hosting extracted from the platform monolith, with CI deploy to /var/www/ladill-hosting matching Bird/Domains/Email. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
namespace App\Jobs;
|
||||
|
||||
use App\Models\ContaboInfrastructureProvision;
|
||||
use App\Services\Infrastructure\ContaboInfrastructureProvisioner;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Queue\Queueable;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class ProvisionContaboInfrastructureJob implements ShouldQueue
|
||||
{
|
||||
use Queueable;
|
||||
|
||||
public int $tries = 30;
|
||||
|
||||
public int $backoff = 60;
|
||||
|
||||
public function __construct(
|
||||
public ContaboInfrastructureProvision $provision,
|
||||
) {}
|
||||
|
||||
public function handle(ContaboInfrastructureProvisioner $provisioner): void
|
||||
{
|
||||
$provision = $this->provision->fresh();
|
||||
|
||||
if (! $provision) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
if ($provision->status === ContaboInfrastructureProvision::STATUS_PENDING) {
|
||||
$provisioner->createContaboInstance($provision);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if ($provision->status === ContaboInfrastructureProvision::STATUS_WAITING_IP) {
|
||||
if (! $provisioner->pollInstanceIp($provision)) {
|
||||
self::dispatch($provision)->delay(now()->addSeconds(30));
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if ($provision->status === ContaboInfrastructureProvision::STATUS_BOOTSTRAPPING) {
|
||||
self::dispatch($provision)->delay(now()->addMinutes(2));
|
||||
}
|
||||
} catch (\Throwable $e) {
|
||||
Log::error('Contabo infrastructure provision failed', [
|
||||
'provision_id' => $provision->id,
|
||||
'error' => $e->getMessage(),
|
||||
]);
|
||||
$provision->markFailed($e->getMessage());
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user