Files
laravel_school_api_old/app/Console/Commands/ReleaseReadinessGateCommand.php
T
2026-05-29 04:33:03 -04:00

27 lines
916 B
PHP

<?php
namespace App\Console\Commands;
use App\Support\Release\ReleaseReadinessGate;
use Illuminate\Console\Command;
final class ReleaseReadinessGateCommand extends Command
{
protected $signature = 'app:release-readiness-gate {--warning-mode}';
protected $description = 'Evaluate modular release readiness artifacts and gates.';
public function handle(ReleaseReadinessGate $gate): int
{
$result = $gate->evaluate();
$this->line(json_encode($result, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
if ($result['status'] !== 'pass') {
$this->warn('Release readiness gate failed. Fix artifacts or run in warning mode only for early rollout rehearsals.');
return $this->option('warning-mode') ? self::SUCCESS : self::FAILURE;
}
$this->info('Release readiness gate passed. Disturbingly competent.');
return self::SUCCESS;
}
}