An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
feat: save commit message and better view on deployments
Andras Bacsai3f1b7192ff7e
diff --git a/app/Models/ApplicationDeploymentQueue.php b/app/Models/ApplicationDeploymentQueue.phpindex 7f3f36d0a9..a55d3a4a25 100644--- a/app/Models/ApplicationDeploymentQueue.php+++ b/app/Models/ApplicationDeploymentQueue.php@@ -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') {diff --git a/database/migrations/2024_05_15_091757_add_commit_message_to_app_deployment_queue.php b/database/migrations/2024_05_15_091757_add_commit_message_to_app_deployment_queue.phpnew file mode 100644index 0000000000..0128e2be56--- /dev/null+++ b/database/migrations/2024_05_15_091757_add_commit_message_to_app_deployment_queue.php@@ -0,0 +1,28 @@+<?php++use Illuminate\Database\Migrations\Migration;+use Illuminate\Database\Schema\Blueprint;+use Illuminate\Support\Facades\Schema;++return new class extends Migration+{+ /**+ * Run the migrations.+ */+ public function up(): void+ {+ Schema::table('application_deployment_queues', function (Blueprint $table) {+ $table->string('commit_message', 300)->nullable();+ });+ }++ /**+ * Reverse the migrations.+ */+ public function down(): void+ {+ Schema::table('application_deployment_queues', function (Blueprint $table) {+ $table->dropColumn('commit_message');+ });+ }+};diff --git a/resources/views/livewire/project/application/deployment/index.blade.php b/resources/views/livewire/project/application/deployment/index.blade.phpindex d914eee17d..ea7262a27c 100644--- a/resources/views/livewire/project/application/deployment/index.blade.php+++ b/resources/views/livewire/project/application/deployment/index.blade.php@@ -71,7 +71,12 @@<div class="dark:hover:text-white"x-on:click.stop="goto('{{ $application->gitCommitLink(data_get($deployment, 'commit')) }}')"><div class="text-xs underline">- (SHA {{ data_get($deployment, 'commit') }})</div>+ @if ($deployment->commitMessage())+ ({{data_get_str($deployment, 'commit')->limit(7)}} - {{ $deployment->commitMessage() }})+ @else+ {{ data_get_str($deployment, 'commit')->limit(7) }}+ @endif+ </div></div>@endif</div>