Add managed registry provisioning, pruning, and readiness tracking
This commit is contained in:
@@ -7,11 +7,16 @@ use App\Jobs\Environments\DeployEnvironment;
|
||||
use App\Models\Application;
|
||||
use App\Models\Environment;
|
||||
use App\Models\Organisation;
|
||||
use App\Services\Registries\RegistryResolver;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
class EnvironmentDeploymentController extends Controller
|
||||
{
|
||||
public function __construct(
|
||||
private readonly RegistryResolver $registryResolver,
|
||||
) {}
|
||||
|
||||
public function store(StoreEnvironmentDeploymentRequest $request, Organisation $organisation, Application $application, Environment $environment): RedirectResponse
|
||||
{
|
||||
abort_unless(
|
||||
@@ -22,7 +27,7 @@ class EnvironmentDeploymentController extends Controller
|
||||
|
||||
$environment->loadMissing('services.replicas');
|
||||
|
||||
if ($organisation->registries()->doesntExist() && $this->serverIdsFor($environment)->count() > 1) {
|
||||
if (! $this->registryResolver->buildRegistryFor($organisation) && $this->serverIdsFor($environment)->count() > 1) {
|
||||
return back()->with('error', 'Configure a registry before deploying this environment to multiple servers.');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user