argument('organisation'); $organisation = Organisation::query() ->where('id', $organisationKey) ->orWhere('slug', $organisationKey) ->firstOrFail(); $url = (string) ($this->option('url') ?: config('keystone.managed_registry.url')); if ($url === '') { $this->error('Provide --url or KEYSTONE_MANAGED_REGISTRY_URL.'); return self::FAILURE; } $controlServer = $this->option('control-server') ? Server::query() ->where('organisation_id', $organisation->id) ->findOrFail((int) $this->option('control-server')) : null; $registry = $provisioner->provision( organisation: $organisation, url: $url, controlServer: $controlServer, storagePath: $this->option('storage-path') ? (string) $this->option('storage-path') : null, retention: $this->option('retention') ? (int) $this->option('retention') : null, ); $blocker = $health->readinessBlocker($registry); if ($this->option('mark-healthy') && $blocker !== null && $blocker !== 'Managed registry has not passed readiness checks.') { $this->error($blocker); return self::FAILURE; } if ($this->option('mark-healthy')) { $registry->markHealthy('Marked ready by provisioning command.'); $blocker = null; } $this->info("Managed registry {$registry->url} persisted for {$organisation->name}."); if ($blocker !== null) { $this->warn($blocker); } if ($this->option('create-operation')) { $operation = $operations->execute($registry); $this->info("Created registry provision operation {$operation->id}."); if ($this->option('dispatch')) { $operation->steps()->orderBy('order')->first()?->dispatchJob(); $this->info('Dispatched registry provision operation.'); } } return self::SUCCESS; } }