mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-15 04:18:34 +00:00
chore: inspect staged changes for commit message
This commit is contained in:
1 parent
981b670eb4
commit
22f9f96db6
16 files changed
+1071
-142
No files matched your search
@@ -4,6 +4,7 @@ namespace App\Console\Commands\Generate;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Facades\Process;
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
|
||||
class Services extends Command
|
||||
@@ -77,6 +78,7 @@ class Services extends Command
|
||||
'category' => $data->get('category'),
|
||||
'logo' => $data->get('logo', 'svgs/default.webp'),
|
||||
'minversion' => $data->get('minversion', '0.0.0'),
|
||||
'template_last_updated_at' => $this->templateLastUpdatedAt($file),
|
||||
];
|
||||
|
||||
if ($port = $data->get('port')) {
|
||||
@@ -99,6 +101,26 @@ class Services extends Command
|
||||
return $payload;
|
||||
}
|
||||
|
||||
private function templateLastUpdatedAt(string $file): ?string
|
||||
{
|
||||
$process = Process::path(base_path())->run([
|
||||
'git',
|
||||
'log',
|
||||
'-1',
|
||||
'--format=%cI',
|
||||
'--',
|
||||
"templates/compose/{$file}",
|
||||
]);
|
||||
|
||||
if ($process->failed()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$timestamp = trim($process->output());
|
||||
|
||||
return $timestamp === '' ? null : $timestamp;
|
||||
}
|
||||
|
||||
private function generateServiceTemplatesWithFqdn(): void
|
||||
{
|
||||
$serviceTemplatesWithFqdn = collect(array_merge(
|
||||
@@ -155,6 +177,7 @@ class Services extends Command
|
||||
'category' => $data->get('category'),
|
||||
'logo' => $data->get('logo', 'svgs/default.webp'),
|
||||
'minversion' => $data->get('minversion', '0.0.0'),
|
||||
'template_last_updated_at' => $this->templateLastUpdatedAt($file),
|
||||
];
|
||||
|
||||
if ($port = $data->get('port')) {
|
||||
@@ -232,6 +255,7 @@ class Services extends Command
|
||||
'category' => $data->get('category'),
|
||||
'logo' => $data->get('logo', 'svgs/default.webp'),
|
||||
'minversion' => $data->get('minversion', '0.0.0'),
|
||||
'template_last_updated_at' => $this->templateLastUpdatedAt($file),
|
||||
];
|
||||
|
||||
if ($port = $data->get('port')) {
|
||||
|
||||
Reference in new issue
Block a user