Implement Keystone environment deployments

This commit is contained in:
2026-05-13 16:11:23 +01:00
parent 65d3142d03
commit aa680b25fd
175 changed files with 10258 additions and 740 deletions

View File

@@ -44,14 +44,9 @@ class Server extends Model
return $this->hasMany(Service::class);
}
public function instances(): HasMany
public function serviceReplicas(): HasMany
{
return $this->hasMany(Instance::class);
}
public function applications(): HasManyThrough
{
return $this->hasManyThrough(Application::class, Instance::class);
return $this->hasMany(ServiceReplica::class);
}
public function firewallRules(): HasMany
@@ -64,26 +59,16 @@ class Server extends Model
return $this->belongsTo(Provider::class);
}
public function serviceDeployments(): HasManyThrough
public function serviceOperations(): HasManyThrough
{
return $this->hasManyThrough(
Deployment::class,
Operation::class,
Service::class,
'server_id',
'target_id',
)->where('target_type', (new Service)->getMorphClass());
}
public function applicationDeployments(): HasManyThrough
{
return $this->hasManyThrough(
Deployment::class,
Application::class,
'server_id',
'target_id',
)->where('target_type', (new Application)->getMorphClass());
}
public function sshClient(string $user = 'root'): Ssh
{
return Ssh::create($user, $this->ipv4)