feat: save commit message and better view on deployments
This commit is contained in:
parent
b992b19c66
commit
3f1b7192ff
@ -9,7 +9,8 @@ class ApplicationDeploymentQueue extends Model
|
|||||||
{
|
{
|
||||||
protected $guarded = [];
|
protected $guarded = [];
|
||||||
|
|
||||||
public function setStatus(string $status) {
|
public function setStatus(string $status)
|
||||||
|
{
|
||||||
$this->update([
|
$this->update([
|
||||||
'status' => $status,
|
'status' => $status,
|
||||||
]);
|
]);
|
||||||
@ -21,7 +22,13 @@ class ApplicationDeploymentQueue extends Model
|
|||||||
}
|
}
|
||||||
return collect(json_decode($this->logs))->where('name', $name)->first()?->output ?? null;
|
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)
|
public function addLogEntry(string $message, string $type = 'stdout', bool $hidden = false)
|
||||||
{
|
{
|
||||||
if ($type === 'error') {
|
if ($type === 'error') {
|
||||||
|
@ -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');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
@ -71,7 +71,12 @@
|
|||||||
<div class="dark:hover:text-white"
|
<div class="dark:hover:text-white"
|
||||||
x-on:click.stop="goto('{{ $application->gitCommitLink(data_get($deployment, 'commit')) }}')">
|
x-on:click.stop="goto('{{ $application->gitCommitLink(data_get($deployment, 'commit')) }}')">
|
||||||
<div class="text-xs underline">
|
<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>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user