mirror of
https://github.com/coollabsio/coolify.git
synced 2026-03-11 08:55:47 +00:00
Merge ddab9e81e7 into e436eeef91
This commit is contained in:
commit
a7bf28ca35
6 changed files with 90 additions and 0 deletions
|
|
@ -35,6 +35,7 @@ use OpenApi\Attributes as OA;
|
||||||
'only_this_server' => ['type' => 'boolean'],
|
'only_this_server' => ['type' => 'boolean'],
|
||||||
'rollback' => ['type' => 'boolean'],
|
'rollback' => ['type' => 'boolean'],
|
||||||
'commit_message' => ['type' => 'string'],
|
'commit_message' => ['type' => 'string'],
|
||||||
|
'commit_author' => ['type' => 'string'],
|
||||||
],
|
],
|
||||||
)]
|
)]
|
||||||
class ApplicationDeploymentQueue extends Model
|
class ApplicationDeploymentQueue extends Model
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
namespace App\Notifications\Application;
|
namespace App\Notifications\Application;
|
||||||
|
|
||||||
use App\Models\Application;
|
use App\Models\Application;
|
||||||
|
use App\Models\ApplicationDeploymentQueue;
|
||||||
use App\Models\ApplicationPreview;
|
use App\Models\ApplicationPreview;
|
||||||
use App\Notifications\CustomEmailNotification;
|
use App\Notifications\CustomEmailNotification;
|
||||||
use App\Notifications\Dto\DiscordMessage;
|
use App\Notifications\Dto\DiscordMessage;
|
||||||
|
|
@ -63,11 +64,14 @@ class DeploymentFailed extends CustomEmailNotification
|
||||||
$fqdn = $this->preview->fqdn;
|
$fqdn = $this->preview->fqdn;
|
||||||
$mail->subject('Coolify: Deployment failed of pull request #'.$this->preview->pull_request_id.' of '.$this->application_name.'.');
|
$mail->subject('Coolify: Deployment failed of pull request #'.$this->preview->pull_request_id.' of '.$this->application_name.'.');
|
||||||
}
|
}
|
||||||
|
$deployment = ApplicationDeploymentQueue::where('deployment_uuid', $this->deployment_uuid)->first();
|
||||||
|
|
||||||
$mail->view('emails.application-deployment-failed', [
|
$mail->view('emails.application-deployment-failed', [
|
||||||
'name' => $this->application_name,
|
'name' => $this->application_name,
|
||||||
'fqdn' => $fqdn,
|
'fqdn' => $fqdn,
|
||||||
'deployment_url' => $this->deployment_url,
|
'deployment_url' => $this->deployment_url,
|
||||||
'pull_request_id' => data_get($this->preview, 'pull_request_id', 0),
|
'pull_request_id' => data_get($this->preview, 'pull_request_id', 0),
|
||||||
|
'commit_author' => $deployment?->commit_author,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return $mail;
|
return $mail;
|
||||||
|
|
@ -111,6 +115,11 @@ class DeploymentFailed extends CustomEmailNotification
|
||||||
$message->addField('Deployment Logs', '[Link]('.$this->deployment_url.')');
|
$message->addField('Deployment Logs', '[Link]('.$this->deployment_url.')');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$deployment = ApplicationDeploymentQueue::where('deployment_uuid', $this->deployment_uuid)->first();
|
||||||
|
if ($deployment && $deployment->commit_author) {
|
||||||
|
$message->addField('Commit Author', $deployment->commit_author, true);
|
||||||
|
}
|
||||||
|
|
||||||
return $message;
|
return $message;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -121,6 +130,12 @@ class DeploymentFailed extends CustomEmailNotification
|
||||||
} else {
|
} else {
|
||||||
$message = 'Coolify: Deployment failed of '.$this->application_name.' ('.$this->fqdn.'): ';
|
$message = 'Coolify: Deployment failed of '.$this->application_name.' ('.$this->fqdn.'): ';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$deployment = ApplicationDeploymentQueue::where('deployment_uuid', $this->deployment_uuid)->first();
|
||||||
|
if ($deployment && $deployment->commit_author) {
|
||||||
|
$message .= "\nCommit Author: {$deployment->commit_author}";
|
||||||
|
}
|
||||||
|
|
||||||
$buttons[] = [
|
$buttons[] = [
|
||||||
'text' => 'Deployment logs',
|
'text' => 'Deployment logs',
|
||||||
'url' => $this->deployment_url,
|
'url' => $this->deployment_url,
|
||||||
|
|
@ -144,6 +159,11 @@ class DeploymentFailed extends CustomEmailNotification
|
||||||
$message = "Deployment failed for {$this->application_name}";
|
$message = "Deployment failed for {$this->application_name}";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$deployment = ApplicationDeploymentQueue::where('deployment_uuid', $this->deployment_uuid)->first();
|
||||||
|
if ($deployment && $deployment->commit_author) {
|
||||||
|
$message .= "\nCommit Author: {$deployment->commit_author}";
|
||||||
|
}
|
||||||
|
|
||||||
$buttons[] = [
|
$buttons[] = [
|
||||||
'text' => 'Deployment logs',
|
'text' => 'Deployment logs',
|
||||||
'url' => $this->deployment_url,
|
'url' => $this->deployment_url,
|
||||||
|
|
@ -175,6 +195,11 @@ class DeploymentFailed extends CustomEmailNotification
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$deployment = ApplicationDeploymentQueue::where('deployment_uuid', $this->deployment_uuid)->first();
|
||||||
|
if ($deployment && $deployment->commit_author) {
|
||||||
|
$description .= "\n*Commit Author:* {$deployment->commit_author}";
|
||||||
|
}
|
||||||
|
|
||||||
$description .= "\n\n*Project:* ".data_get($this->application, 'environment.project.name');
|
$description .= "\n\n*Project:* ".data_get($this->application, 'environment.project.name');
|
||||||
$description .= "\n*Environment:* {$this->environment_name}";
|
$description .= "\n*Environment:* {$this->environment_name}";
|
||||||
$description .= "\n*<{$this->deployment_url}|Deployment Logs>*";
|
$description .= "\n*<{$this->deployment_url}|Deployment Logs>*";
|
||||||
|
|
@ -209,6 +234,11 @@ class DeploymentFailed extends CustomEmailNotification
|
||||||
$data['fqdn'] = $this->fqdn;
|
$data['fqdn'] = $this->fqdn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$deployment = ApplicationDeploymentQueue::where('deployment_uuid', $this->deployment_uuid)->first();
|
||||||
|
if ($deployment && $deployment->commit_author) {
|
||||||
|
$data['commit_author'] = $deployment->commit_author;
|
||||||
|
}
|
||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
namespace App\Notifications\Application;
|
namespace App\Notifications\Application;
|
||||||
|
|
||||||
use App\Models\Application;
|
use App\Models\Application;
|
||||||
|
use App\Models\ApplicationDeploymentQueue;
|
||||||
use App\Models\ApplicationPreview;
|
use App\Models\ApplicationPreview;
|
||||||
use App\Notifications\CustomEmailNotification;
|
use App\Notifications\CustomEmailNotification;
|
||||||
use App\Notifications\Dto\DiscordMessage;
|
use App\Notifications\Dto\DiscordMessage;
|
||||||
|
|
@ -63,11 +64,14 @@ class DeploymentSuccess extends CustomEmailNotification
|
||||||
$fqdn = $this->preview->fqdn;
|
$fqdn = $this->preview->fqdn;
|
||||||
$mail->subject("Coolify: Pull request #{$pull_request_id} of {$this->application_name} deployed successfully");
|
$mail->subject("Coolify: Pull request #{$pull_request_id} of {$this->application_name} deployed successfully");
|
||||||
}
|
}
|
||||||
|
$deployment = ApplicationDeploymentQueue::where('deployment_uuid', $this->deployment_uuid)->first();
|
||||||
|
|
||||||
$mail->view('emails.application-deployment-success', [
|
$mail->view('emails.application-deployment-success', [
|
||||||
'name' => $this->application_name,
|
'name' => $this->application_name,
|
||||||
'fqdn' => $fqdn,
|
'fqdn' => $fqdn,
|
||||||
'deployment_url' => $this->deployment_url,
|
'deployment_url' => $this->deployment_url,
|
||||||
'pull_request_id' => $pull_request_id,
|
'pull_request_id' => $pull_request_id,
|
||||||
|
'commit_author' => $deployment?->commit_author,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return $mail;
|
return $mail;
|
||||||
|
|
@ -108,6 +112,11 @@ class DeploymentSuccess extends CustomEmailNotification
|
||||||
$message->addField('Deployment logs', '[Link]('.$this->deployment_url.')');
|
$message->addField('Deployment logs', '[Link]('.$this->deployment_url.')');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$deployment = ApplicationDeploymentQueue::where('deployment_uuid', $this->deployment_uuid)->first();
|
||||||
|
if ($deployment && $deployment->commit_author) {
|
||||||
|
$message->addField('Commit Author', $deployment->commit_author, true);
|
||||||
|
}
|
||||||
|
|
||||||
return $message;
|
return $message;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -130,6 +139,12 @@ class DeploymentSuccess extends CustomEmailNotification
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$deployment = ApplicationDeploymentQueue::where('deployment_uuid', $this->deployment_uuid)->first();
|
||||||
|
if ($deployment && $deployment->commit_author) {
|
||||||
|
$message .= "\nCommit Author: {$deployment->commit_author}";
|
||||||
|
}
|
||||||
|
|
||||||
$buttons[] = [
|
$buttons[] = [
|
||||||
'text' => 'Deployment logs',
|
'text' => 'Deployment logs',
|
||||||
'url' => $this->deployment_url,
|
'url' => $this->deployment_url,
|
||||||
|
|
@ -164,6 +179,12 @@ class DeploymentSuccess extends CustomEmailNotification
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$deployment = ApplicationDeploymentQueue::where('deployment_uuid', $this->deployment_uuid)->first();
|
||||||
|
if ($deployment && $deployment->commit_author) {
|
||||||
|
$message .= "\nCommit Author: {$deployment->commit_author}";
|
||||||
|
}
|
||||||
|
|
||||||
$buttons[] = [
|
$buttons[] = [
|
||||||
'text' => 'Deployment logs',
|
'text' => 'Deployment logs',
|
||||||
'url' => $this->deployment_url,
|
'url' => $this->deployment_url,
|
||||||
|
|
@ -194,6 +215,10 @@ class DeploymentSuccess extends CustomEmailNotification
|
||||||
$description .= "\nApplication URL: {$this->fqdn}";
|
$description .= "\nApplication URL: {$this->fqdn}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$deployment = ApplicationDeploymentQueue::where('deployment_uuid', $this->deployment_uuid)->first();
|
||||||
|
if ($deployment && $deployment->commit_author) {
|
||||||
|
$description .= "\n*Commit Author:* {$deployment->commit_author}";
|
||||||
|
}
|
||||||
|
|
||||||
$description .= "\n\n*Project:* ".data_get($this->application, 'environment.project.name');
|
$description .= "\n\n*Project:* ".data_get($this->application, 'environment.project.name');
|
||||||
$description .= "\n*Environment:* {$this->environment_name}";
|
$description .= "\n*Environment:* {$this->environment_name}";
|
||||||
|
|
@ -229,6 +254,11 @@ class DeploymentSuccess extends CustomEmailNotification
|
||||||
$data['fqdn'] = $this->fqdn;
|
$data['fqdn'] = $this->fqdn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$deployment = ApplicationDeploymentQueue::where('deployment_uuid', $this->deployment_uuid)->first();
|
||||||
|
if ($deployment && $deployment->commit_author) {
|
||||||
|
$data['commit_author'] = $deployment->commit_author;
|
||||||
|
}
|
||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration {
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::table('application_deployment_queues', function (Blueprint $table) {
|
||||||
|
$table->string('commit_author')->nullable()->after('commit_message');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::table('application_deployment_queues', function (Blueprint $table) {
|
||||||
|
$table->dropColumn('commit_author');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
@ -6,5 +6,9 @@ Failed to deploy a pull request #{{ $pull_request_id }} of {{ $name }} at
|
||||||
[{{ $fqdn }}]({{ $fqdn }}).
|
[{{ $fqdn }}]({{ $fqdn }}).
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
@if (isset($commit_author))
|
||||||
|
Commit Author: {{ $commit_author }}
|
||||||
|
@endif
|
||||||
|
|
||||||
[View Deployment Logs]({{ $deployment_url }})
|
[View Deployment Logs]({{ $deployment_url }})
|
||||||
</x-emails.layout>
|
</x-emails.layout>
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,10 @@ Pull request #{{ $pull_request_id }} of {{ $name }} deployed successfully
|
||||||
[{{ $fqdn }}]({{ $fqdn }}).
|
[{{ $fqdn }}]({{ $fqdn }}).
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
@if (isset($commit_author))
|
||||||
|
Commit Author: {{ $commit_author }}
|
||||||
|
@endif
|
||||||
|
|
||||||
[View Deployment Logs]({{ $deployment_url }})
|
[View Deployment Logs]({{ $deployment_url }})
|
||||||
|
|
||||||
</x-emails.layout>
|
</x-emails.layout>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue