mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-01 05:56:16 +00:00
Accurate deployment statuses (#168)
This commit is contained in:
@ -115,4 +115,27 @@ public static function log(Server $server, string $type, string $content, ?Site
|
||||
$log->save();
|
||||
$log->write($content);
|
||||
}
|
||||
|
||||
public static function make(Server $server, string $type): ServerLog
|
||||
{
|
||||
return new static([
|
||||
'server_id' => $server->id,
|
||||
'name' => $server->id.'-'.strtotime('now').'-'.$type.'.log',
|
||||
'type' => $type,
|
||||
'disk' => config('core.logs_disk'),
|
||||
]);
|
||||
}
|
||||
|
||||
public function forSite(Site|int $site): ServerLog
|
||||
{
|
||||
if ($site instanceof Site) {
|
||||
$site = $site->id;
|
||||
}
|
||||
|
||||
if (is_int($site)) {
|
||||
$this->site_id = $site;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user