add delete_connected_networks function to services.php
This commit is contained in:
parent
d980c7a425
commit
97c2bedda2
2 changed files with 11 additions and 6 deletions
|
|
@ -151,7 +151,6 @@ 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);
|
||||
}
|
||||
}
|
||||
|
|
@ -176,7 +175,6 @@ public function delete_volumes(?Collection $persistentStorages)
|
|||
public function delete_connected_networks($uuid)
|
||||
{
|
||||
$server = data_get($this, 'destination.server');
|
||||
ray($uuid);
|
||||
instant_remote_process(["docker network disconnect {$uuid} coolify-proxy"], $server, false);
|
||||
instant_remote_process(["docker network rm {$uuid}"], $server, false);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ public function isConfigurationChanged(bool $save = false)
|
|||
$databaseStorages = $this->databases()->get()->pluck('persistentStorages')->flatten()->sortBy('id');
|
||||
$storages = $applicationStorages->merge($databaseStorages)->implode('updated_at');
|
||||
|
||||
$newConfigHash = $images.$domains.$images.$storages;
|
||||
$newConfigHash = $images . $domains . $images . $storages;
|
||||
$newConfigHash .= json_encode($this->environment_variables()->get('value')->sort());
|
||||
$newConfigHash = md5($newConfigHash);
|
||||
$oldConfigHash = data_get($this, 'config_hash');
|
||||
|
|
@ -121,13 +121,20 @@ public function tags()
|
|||
|
||||
public function delete_configurations()
|
||||
{
|
||||
$server = data_get($this, 'server');
|
||||
$server = data_get($this, 'destination.server');
|
||||
$workdir = $this->workdir();
|
||||
if (str($workdir)->endsWith($this->uuid)) {
|
||||
instant_remote_process(['rm -rf '.$this->workdir()], $server, false);
|
||||
instant_remote_process(['rm -rf ' . $this->workdir()], $server, false);
|
||||
}
|
||||
}
|
||||
|
||||
public function delete_connected_networks($uuid)
|
||||
{
|
||||
$server = data_get($this, 'destination.server');
|
||||
instant_remote_process(["docker network disconnect {$uuid} coolify-proxy"], $server, false);
|
||||
instant_remote_process(["docker network rm {$uuid}"], $server, false);
|
||||
}
|
||||
|
||||
public function status()
|
||||
{
|
||||
$applications = $this->applications;
|
||||
|
|
@ -907,7 +914,7 @@ public function environment_variables_preview(): HasMany
|
|||
|
||||
public function workdir()
|
||||
{
|
||||
return service_configuration_dir()."/{$this->uuid}";
|
||||
return service_configuration_dir() . "/{$this->uuid}";
|
||||
}
|
||||
|
||||
public function saveComposeConfigs()
|
||||
|
|
|
|||
Loading…
Reference in a new issue