feat: able to delete configuration from server
This commit is contained in:
@@ -57,6 +57,15 @@ class Application extends BaseModel
|
||||
});
|
||||
}
|
||||
|
||||
public function delete_configurations()
|
||||
{
|
||||
$server = data_get($this, 'destination.server');
|
||||
$workdir = $this->workdir();
|
||||
if (str($workdir)->endsWith($this->uuid)) {
|
||||
ray('Deleting workdir');
|
||||
instant_remote_process(["rm -rf " . $this->workdir()], $server, false);
|
||||
}
|
||||
}
|
||||
public function additional_servers()
|
||||
{
|
||||
return $this->belongsToMany(Server::class, 'additional_destinations')
|
||||
|
||||
@@ -27,6 +27,14 @@ class Service extends BaseModel
|
||||
{
|
||||
return $this->morphToMany(Tag::class, 'taggable');
|
||||
}
|
||||
public function delete_configurations()
|
||||
{
|
||||
$server = data_get($this, 'server');
|
||||
$workdir = $this->workdir();
|
||||
if (str($workdir)->endsWith($this->uuid)) {
|
||||
instant_remote_process(["rm -rf " . $this->workdir()], $server, false);
|
||||
}
|
||||
}
|
||||
public function status()
|
||||
{
|
||||
$applications = $this->applications;
|
||||
|
||||
@@ -44,7 +44,15 @@ class StandaloneClickhouse extends BaseModel
|
||||
}
|
||||
public function workdir()
|
||||
{
|
||||
return database_configuration_dir() . '/' . $this->uuid;
|
||||
return database_configuration_dir() . "/{$this->uuid}";
|
||||
}
|
||||
public function delete_configurations()
|
||||
{
|
||||
$server = data_get($this, 'destination.server');
|
||||
$workdir = $this->workdir();
|
||||
if (str($workdir)->endsWith($this->uuid)) {
|
||||
instant_remote_process(["rm -rf " . $this->workdir()], $server, false);
|
||||
}
|
||||
}
|
||||
public function realStatus()
|
||||
{
|
||||
|
||||
@@ -42,6 +42,18 @@ class StandaloneDragonfly extends BaseModel
|
||||
});
|
||||
}
|
||||
|
||||
public function workdir()
|
||||
{
|
||||
return database_configuration_dir() . "/{$this->uuid}";
|
||||
}
|
||||
public function delete_configurations()
|
||||
{
|
||||
$server = data_get($this, 'destination.server');
|
||||
$workdir = $this->workdir();
|
||||
if (str($workdir)->endsWith($this->uuid)) {
|
||||
instant_remote_process(["rm -rf " . $this->workdir()], $server, false);
|
||||
}
|
||||
}
|
||||
public function realStatus()
|
||||
{
|
||||
return $this->getRawOriginal('status');
|
||||
|
||||
@@ -42,6 +42,19 @@ class StandaloneKeydb extends BaseModel
|
||||
});
|
||||
}
|
||||
|
||||
public function workdir()
|
||||
{
|
||||
return database_configuration_dir() . "/{$this->uuid}";
|
||||
}
|
||||
public function delete_configurations()
|
||||
{
|
||||
$server = data_get($this, 'destination.server');
|
||||
$workdir = $this->workdir();
|
||||
if (str($workdir)->endsWith($this->uuid)) {
|
||||
instant_remote_process(["rm -rf " . $this->workdir()], $server, false);
|
||||
}
|
||||
}
|
||||
|
||||
public function realStatus()
|
||||
{
|
||||
return $this->getRawOriginal('status');
|
||||
|
||||
@@ -43,6 +43,18 @@ class StandaloneMariadb extends BaseModel
|
||||
$database->tags()->detach();
|
||||
});
|
||||
}
|
||||
public function workdir()
|
||||
{
|
||||
return database_configuration_dir() . "/{$this->uuid}";
|
||||
}
|
||||
public function delete_configurations()
|
||||
{
|
||||
$server = data_get($this, 'destination.server');
|
||||
$workdir = $this->workdir();
|
||||
if (str($workdir)->endsWith($this->uuid)) {
|
||||
instant_remote_process(["rm -rf " . $this->workdir()], $server, false);
|
||||
}
|
||||
}
|
||||
public function realStatus()
|
||||
{
|
||||
return $this->getRawOriginal('status');
|
||||
|
||||
@@ -46,6 +46,18 @@ class StandaloneMongodb extends BaseModel
|
||||
$database->tags()->detach();
|
||||
});
|
||||
}
|
||||
public function workdir()
|
||||
{
|
||||
return database_configuration_dir() . "/{$this->uuid}";
|
||||
}
|
||||
public function delete_configurations()
|
||||
{
|
||||
$server = data_get($this, 'destination.server');
|
||||
$workdir = $this->workdir();
|
||||
if (str($workdir)->endsWith($this->uuid)) {
|
||||
instant_remote_process(["rm -rf " . $this->workdir()], $server, false);
|
||||
}
|
||||
}
|
||||
public function realStatus()
|
||||
{
|
||||
return $this->getRawOriginal('status');
|
||||
|
||||
@@ -43,6 +43,18 @@ class StandaloneMysql extends BaseModel
|
||||
$database->tags()->detach();
|
||||
});
|
||||
}
|
||||
public function workdir()
|
||||
{
|
||||
return database_configuration_dir() . "/{$this->uuid}";
|
||||
}
|
||||
public function delete_configurations()
|
||||
{
|
||||
$server = data_get($this, 'destination.server');
|
||||
$workdir = $this->workdir();
|
||||
if (str($workdir)->endsWith($this->uuid)) {
|
||||
instant_remote_process(["rm -rf " . $this->workdir()], $server, false);
|
||||
}
|
||||
}
|
||||
public function realStatus()
|
||||
{
|
||||
return $this->getRawOriginal('status');
|
||||
|
||||
@@ -43,6 +43,18 @@ class StandalonePostgresql extends BaseModel
|
||||
$database->tags()->detach();
|
||||
});
|
||||
}
|
||||
public function workdir()
|
||||
{
|
||||
return database_configuration_dir() . "/{$this->uuid}";
|
||||
}
|
||||
public function delete_configurations()
|
||||
{
|
||||
$server = data_get($this, 'destination.server');
|
||||
$workdir = $this->workdir();
|
||||
if (str($workdir)->endsWith($this->uuid)) {
|
||||
instant_remote_process(["rm -rf " . $this->workdir()], $server, false);
|
||||
}
|
||||
}
|
||||
public function realStatus()
|
||||
{
|
||||
return $this->getRawOriginal('status');
|
||||
|
||||
@@ -38,6 +38,18 @@ class StandaloneRedis extends BaseModel
|
||||
$database->tags()->detach();
|
||||
});
|
||||
}
|
||||
public function workdir()
|
||||
{
|
||||
return database_configuration_dir() . "/{$this->uuid}";
|
||||
}
|
||||
public function delete_configurations()
|
||||
{
|
||||
$server = data_get($this, 'destination.server');
|
||||
$workdir = $this->workdir();
|
||||
if (str($workdir)->endsWith($this->uuid)) {
|
||||
instant_remote_process(["rm -rf " . $this->workdir()], $server, false);
|
||||
}
|
||||
}
|
||||
public function realStatus()
|
||||
{
|
||||
return $this->getRawOriginal('status');
|
||||
|
||||
Reference in New Issue
Block a user