mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-02 14:36:17 +00:00
Accurate deployment statuses (#168)
This commit is contained in:
@ -127,16 +127,18 @@ public function tail(string $path, int $lines): string
|
||||
);
|
||||
}
|
||||
|
||||
public function runScript(string $path, string $script, ?int $siteId = null): ServerLog
|
||||
public function runScript(string $path, string $script, ?ServerLog $serverLog): ServerLog
|
||||
{
|
||||
$ssh = $this->server->ssh();
|
||||
if ($serverLog) {
|
||||
$ssh->setLog($serverLog);
|
||||
}
|
||||
$ssh->exec(
|
||||
$this->getScript('run-script.sh', [
|
||||
'path' => $path,
|
||||
'script' => $script,
|
||||
]),
|
||||
'run-script',
|
||||
$siteId
|
||||
'run-script'
|
||||
);
|
||||
|
||||
return $ssh->log;
|
||||
|
@ -5,6 +5,7 @@
|
||||
use App\Models\Metric;
|
||||
use App\SSH\HasScripts;
|
||||
use App\SSH\Services\AbstractService;
|
||||
use Closure;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Validation\Rule;
|
||||
use Ramsey\Uuid\Uuid;
|
||||
@ -21,7 +22,12 @@ public function creationRules(array $input): array
|
||||
{
|
||||
return [
|
||||
'type' => [
|
||||
Rule::unique('services', 'type')->where('server_id', $this->service->server_id),
|
||||
function (string $attribute, mixed $value, Closure $fail) {
|
||||
$monitoringExists = $this->service->server->monitoring();
|
||||
if ($monitoringExists) {
|
||||
$fail('You already have a monitoring service on the server.');
|
||||
}
|
||||
},
|
||||
],
|
||||
'version' => [
|
||||
'required',
|
||||
|
Reference in New Issue
Block a user