mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-04 07:22:34 +00:00
init
This commit is contained in:
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\SSHCommands\ProcessManager\Supervisor;
|
||||
|
||||
use App\SSHCommands\Command;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class CreateWorkerCommand extends Command
|
||||
{
|
||||
protected $id;
|
||||
|
||||
protected $config;
|
||||
|
||||
public function __construct($id, $config)
|
||||
{
|
||||
$this->id = $id;
|
||||
$this->config = $config;
|
||||
}
|
||||
|
||||
public function file(string $os): string
|
||||
{
|
||||
return File::get(base_path('system/commands/ubuntu/process-manager/supervisor/create-worker.sh'));
|
||||
}
|
||||
|
||||
public function content(string $os): string
|
||||
{
|
||||
$command = $this->file($os);
|
||||
$command = Str::replace('__id__', $this->id, $command);
|
||||
|
||||
return Str::replace('__config__', $this->config, $command);
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\SSHCommands\ProcessManager\Supervisor;
|
||||
|
||||
use App\SSHCommands\Command;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class DeleteWorkerCommand extends Command
|
||||
{
|
||||
protected $id;
|
||||
|
||||
public function __construct($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
}
|
||||
|
||||
public function file(string $os): string
|
||||
{
|
||||
return File::get(base_path('system/commands/ubuntu/process-manager/supervisor/delete-worker.sh'));
|
||||
}
|
||||
|
||||
public function content(string $os): string
|
||||
{
|
||||
$command = $this->file($os);
|
||||
|
||||
return Str::replace('__id__', $this->id, $command);
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\SSHCommands\ProcessManager\Supervisor;
|
||||
|
||||
use App\SSHCommands\Command;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class RestartWorkerCommand extends Command
|
||||
{
|
||||
protected $id;
|
||||
|
||||
public function __construct($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
}
|
||||
|
||||
public function file(string $os): string
|
||||
{
|
||||
return File::get(base_path('system/commands/ubuntu/process-manager/supervisor/restart-worker.sh'));
|
||||
}
|
||||
|
||||
public function content(string $os): string
|
||||
{
|
||||
$command = $this->file($os);
|
||||
|
||||
return Str::replace('__id__', $this->id, $command);
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\SSHCommands\ProcessManager\Supervisor;
|
||||
|
||||
use App\SSHCommands\Command;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class StartWorkerCommand extends Command
|
||||
{
|
||||
protected $id;
|
||||
|
||||
public function __construct($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
}
|
||||
|
||||
public function file(string $os): string
|
||||
{
|
||||
return File::get(base_path('system/commands/ubuntu/process-manager/supervisor/start-worker.sh'));
|
||||
}
|
||||
|
||||
public function content(string $os): string
|
||||
{
|
||||
$command = $this->file($os);
|
||||
|
||||
return Str::replace('__id__', $this->id, $command);
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\SSHCommands\ProcessManager\Supervisor;
|
||||
|
||||
use App\SSHCommands\Command;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class StopWorkerCommand extends Command
|
||||
{
|
||||
protected $id;
|
||||
|
||||
public function __construct($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
}
|
||||
|
||||
public function file(string $os): string
|
||||
{
|
||||
return File::get(base_path('system/commands/ubuntu/process-manager/supervisor/stop-worker.sh'));
|
||||
}
|
||||
|
||||
public function content(string $os): string
|
||||
{
|
||||
$command = $this->file($os);
|
||||
|
||||
return Str::replace('__id__', $this->id, $command);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user