feat: save commit message and better view on deployments

This commit is contained in:
Andras Bacsai
2024-05-15 11:31:03 +02:00
parent b992b19c66
commit 3f1b7192ff
3 changed files with 43 additions and 3 deletions

View File

@@ -9,7 +9,8 @@ class ApplicationDeploymentQueue extends Model
{
protected $guarded = [];
public function setStatus(string $status) {
public function setStatus(string $status)
{
$this->update([
'status' => $status,
]);
@@ -21,7 +22,13 @@ class ApplicationDeploymentQueue extends Model
}
return collect(json_decode($this->logs))->where('name', $name)->first()?->output ?? null;
}
public function commitMessage()
{
if (empty($this->commit_message) || is_null($this->commit_message)) {
return null;
}
return str($this->commit_message)->trim()->limit(300)->value();
}
public function addLogEntry(string $message, string $type = 'stdout', bool $hidden = false)
{
if ($type === 'error') {