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 = [];
|
||||
|
||||
public function setStatus(string $status) {
|
||||
public function setStatus(string $status)
|
||||
{
|
||||
$this->update([
|
||||
'status' => $status,
|
||||
]);
|
||||
@ -21,7 +22,13 @@ public function getOutput($name)
|
||||
}
|
||||
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') {
|
||||
|
@ -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 @@ class="w-6 h-6" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<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>
|
||||
|
Loading…
Reference in New Issue
Block a user