feat: minversion for services

This commit is contained in:
Andras Bacsai
2024-02-22 11:53:25 +01:00
parent 4ae2087c2e
commit 63487cf3ec
10 changed files with 165 additions and 71 deletions

View File

@@ -79,6 +79,12 @@ class ServicesGenerate extends Command
} else {
$logo = 'svgs/unknown.svg';
}
$minversion = collect(preg_grep('/^# minversion:/', explode("\n", $content)))->values();
if ($minversion->count() > 0) {
$minversion = str($minversion[0])->after('# minversion:')->trim()->value();
} else {
$minversion = '0.0.0';
}
$env_file = collect(preg_grep('/^# env_file:/', explode("\n", $content)))->values();
if ($env_file->count() > 0) {
$env_file = str($env_file[0])->after('# env_file:')->trim()->value();
@@ -103,6 +109,7 @@ class ServicesGenerate extends Command
'compose' => $yaml,
'tags' => $tags,
'logo' => $logo,
'minversion' => $minversion,
];
if ($env_file) {
$env_file_content = file_get_contents(base_path("templates/compose/$env_file"));

View File

@@ -15,6 +15,7 @@ class ResourceView extends Component
public ?string $wire = null,
public ?string $logo = null,
public ?string $documentation = null,
public bool $upgrade = false,
)
{