mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-04 23:42:34 +00:00
Merge (#127)
This commit is contained in:
22
app/SSH/Composer/Composer.php
Normal file
22
app/SSH/Composer/Composer.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\SSH\Composer;
|
||||
|
||||
use App\Models\Site;
|
||||
use App\SSH\HasScripts;
|
||||
|
||||
class Composer
|
||||
{
|
||||
use HasScripts;
|
||||
|
||||
public function installDependencies(Site $site): void
|
||||
{
|
||||
$site->server->ssh()->exec(
|
||||
$this->getScript('composer-install.sh', [
|
||||
'path' => $site->path,
|
||||
]),
|
||||
'composer-install',
|
||||
$site->id
|
||||
);
|
||||
}
|
||||
}
|
7
app/SSH/Composer/scripts/composer-install.sh
Executable file
7
app/SSH/Composer/scripts/composer-install.sh
Executable file
@ -0,0 +1,7 @@
|
||||
if ! cd __path__; then
|
||||
echo 'VITO_SSH_ERROR' && exit 1
|
||||
fi
|
||||
|
||||
if ! composer install --no-interaction --prefer-dist --optimize-autoloader --no-dev; then
|
||||
echo 'VITO_SSH_ERROR' && exit 1
|
||||
fi
|
Reference in New Issue
Block a user