Improve ApplicationPullRequestUpdateJob message (#5549)
This commit is contained in:
@@ -37,22 +37,23 @@ class ApplicationPullRequestUpdateJob implements ShouldBeEncrypted, ShouldQueue
|
|||||||
}
|
}
|
||||||
if ($this->status === ProcessStatus::CLOSED) {
|
if ($this->status === ProcessStatus::CLOSED) {
|
||||||
$this->delete_comment();
|
$this->delete_comment();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
} elseif ($this->status === ProcessStatus::IN_PROGRESS) {
|
|
||||||
$this->body = "The preview deployment is in progress. 🟡\n\n";
|
|
||||||
} elseif ($this->status === ProcessStatus::FINISHED) {
|
|
||||||
$this->body = "The preview deployment is ready. 🟢\n\n";
|
|
||||||
if ($this->preview->fqdn) {
|
|
||||||
$this->body .= "[Open Preview]({$this->preview->fqdn}) | ";
|
|
||||||
}
|
}
|
||||||
} elseif ($this->status === ProcessStatus::ERROR) {
|
|
||||||
$this->body = "The preview deployment failed. 🔴\n\n";
|
|
||||||
}
|
|
||||||
$this->build_logs_url = base_url()."/project/{$this->application->environment->project->uuid}/{$this->application->environment->name}/application/{$this->application->uuid}/deployment/{$this->deployment_uuid}";
|
|
||||||
|
|
||||||
$this->body .= '[Open Build Logs]('.$this->build_logs_url.")\n\n\n";
|
$this->body = "**Preview of {$this->application->name}**\n\n";
|
||||||
$this->body .= 'Last updated at: '.now()->toDateTimeString().' CET';
|
$this->body .= match ($this->status) {
|
||||||
|
ProcessStatus::IN_PROGRESS => "🟡 Deployment in progress",
|
||||||
|
ProcessStatus::FINISHED => "🟢 Deployment is ready".($this->preview->fqdn ? " | [Open Preview]({$this->preview->fqdn})" : ''),
|
||||||
|
ProcessStatus::ERROR => "🔴 Deployment failed",
|
||||||
|
default => '',
|
||||||
|
};
|
||||||
|
|
||||||
|
$this->build_logs_url = base_url()."/project/{$this->application->environment->project->uuid}/environment/{$this->application->environment->uuid}/application/{$this->application->uuid}/deployment/{$this->deployment_uuid}";
|
||||||
|
$this->body .= " | [Open Build Logs]($this->build_logs_url)\n\n";
|
||||||
|
|
||||||
|
$serverTimezone = $this->application->destination->server->settings->server_timezone ?? 'CET';
|
||||||
|
$this->body .= "Last updated at: ".now($serverTimezone)->toDateTimeString()." ($serverTimezone)";
|
||||||
|
|
||||||
if ($this->preview->pull_request_issue_comment_id) {
|
if ($this->preview->pull_request_issue_comment_id) {
|
||||||
$this->update_comment();
|
$this->update_comment();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user