This commit is contained in:
Andras Bacsai
2023-05-24 15:25:08 +02:00
parent a0306f3951
commit 167379b0e0
23 changed files with 118 additions and 125 deletions

View File

@@ -18,7 +18,7 @@ class Danger extends Component
{
$destination = $this->application->destination->getMorphClass()::where('id', $this->application->destination->id)->first();
instantRemoteProcess(["docker rm -f {$this->application->uuid}"], $destination->server);
instant_remote_process(["docker rm -f {$this->application->uuid}"], $destination->server);
$this->application->delete();
return redirect()->route('project.resources', [
'project_uuid' => $this->parameters['project_uuid'],

View File

@@ -42,13 +42,13 @@ class Rollback extends Component
{
try {
$image = $this->application->uuid;
$output = instantRemoteProcess([
$output = instant_remote_process([
"docker inspect --format='{{.Config.Image}}' {$this->application->uuid}",
], $this->application->destination->server, throwError: false);
$current_tag = Str::of($output)->trim()->explode(":");
$this->current = data_get($current_tag, 1);
$output = instantRemoteProcess([
$output = instant_remote_process([
"docker images --format '{{.Repository}}#{{.Tag}}#{{.CreatedAt}}'",
], $this->application->destination->server);
$this->images = Str::of($output)->trim()->explode("\n")->filter(function ($item) use ($image) {