mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-02 14:36:17 +00:00
init
This commit is contained in:
34
app/Jobs/Site/ComposerInstall.php
Executable file
34
app/Jobs/Site/ComposerInstall.php
Executable file
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Jobs\Site;
|
||||
|
||||
use App\Exceptions\ComposerInstallFailed;
|
||||
use App\Jobs\Job;
|
||||
use App\Models\Site;
|
||||
use App\SSHCommands\ComposerInstallCommand;
|
||||
use Throwable;
|
||||
|
||||
class ComposerInstall extends Job
|
||||
{
|
||||
protected Site $site;
|
||||
|
||||
public function __construct(Site $site)
|
||||
{
|
||||
$this->site = $site;
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws ComposerInstallFailed
|
||||
* @throws Throwable
|
||||
*/
|
||||
public function handle(): void
|
||||
{
|
||||
$this->site->server->ssh()->exec(
|
||||
new ComposerInstallCommand(
|
||||
$this->site->path
|
||||
),
|
||||
'composer-install',
|
||||
$this->site->id
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user