mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-02 14:36:17 +00:00
refactoring
This commit is contained in:
@ -22,6 +22,11 @@ public function delete(): void
|
||||
dispatch(new DeleteSite($this->site))->onConnection('ssh');
|
||||
}
|
||||
|
||||
public function install(): void
|
||||
{
|
||||
// TODO: Implement install() method.
|
||||
}
|
||||
|
||||
protected function progress(int $percentage): Closure
|
||||
{
|
||||
return function () use ($percentage) {
|
||||
|
@ -7,6 +7,7 @@
|
||||
use App\Jobs\Site\CloneRepository;
|
||||
use App\Jobs\Site\ComposerInstall;
|
||||
use App\Jobs\Site\CreateVHost;
|
||||
use App\Jobs\Site\DeployKey;
|
||||
use Illuminate\Support\Facades\Bus;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Validation\Rule;
|
||||
@ -28,7 +29,7 @@ public function createValidationRules(array $input): array
|
||||
],
|
||||
'source_control' => [
|
||||
'required',
|
||||
Rule::exists('source_controls', 'provider'),
|
||||
Rule::exists('source_controls', 'id'),
|
||||
],
|
||||
'repository' => [
|
||||
'required',
|
||||
@ -43,7 +44,7 @@ public function createFields(array $input): array
|
||||
{
|
||||
return [
|
||||
'web_directory' => $input['web_directory'] ?? '',
|
||||
'source_control' => $input['source_control'] ?? '',
|
||||
'source_control_id' => $input['source_control'] ?? '',
|
||||
'repository' => $input['repository'] ?? '',
|
||||
'branch' => $input['branch'] ?? '',
|
||||
];
|
||||
@ -60,6 +61,8 @@ public function install(): void
|
||||
{
|
||||
$chain = [
|
||||
new CreateVHost($this->site),
|
||||
$this->progress(15),
|
||||
new DeployKey($this->site),
|
||||
$this->progress(30),
|
||||
new CloneRepository($this->site),
|
||||
$this->progress(65),
|
||||
|
@ -6,7 +6,7 @@
|
||||
use App\Events\Broadcast;
|
||||
use App\Jobs\Site\CreateVHost;
|
||||
use App\Jobs\Site\InstallWordpress;
|
||||
use App\SSHCommands\UpdateWordpressCommand;
|
||||
use App\SSHCommands\Wordpress\UpdateWordpressCommand;
|
||||
use Illuminate\Support\Facades\Bus;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Throwable;
|
||||
|
Reference in New Issue
Block a user