fix: parser parser
This commit is contained in:
@@ -126,7 +126,7 @@ class Application extends BaseModel
|
|||||||
ApplicationSetting::create([
|
ApplicationSetting::create([
|
||||||
'application_id' => $application->id,
|
'application_id' => $application->id,
|
||||||
]);
|
]);
|
||||||
$application->compose_parsing_version = '2';
|
$application->compose_parsing_version = '3';
|
||||||
$application->save();
|
$application->save();
|
||||||
});
|
});
|
||||||
static::forceDeleting(function ($application) {
|
static::forceDeleting(function ($application) {
|
||||||
@@ -1106,7 +1106,7 @@ class Application extends BaseModel
|
|||||||
if (! $this->docker_compose_raw) {
|
if (! $this->docker_compose_raw) {
|
||||||
return collect([]);
|
return collect([]);
|
||||||
}
|
}
|
||||||
if (isDev()) {
|
if ($this->compose_parsing_version === '3') {
|
||||||
$compose = dockerComposeParserForApplications($this);
|
$compose = dockerComposeParserForApplications($this);
|
||||||
|
|
||||||
return $compose;
|
return $compose;
|
||||||
|
|||||||
@@ -1154,36 +1154,9 @@ function dockerComposeParserForApplications(Application $application): Collectio
|
|||||||
'is_build_time' => false,
|
'is_build_time' => false,
|
||||||
'is_preview' => false,
|
'is_preview' => false,
|
||||||
]);
|
]);
|
||||||
} else {
|
|
||||||
// TODO: Should we add the variable to Coolify's DB? Maybe add a is_hardcoded column
|
|
||||||
$application->environment_variables()->where('key', $key)->where('application_id', $application->id)->firstOrCreate([
|
|
||||||
'key' => $key,
|
|
||||||
'application_id' => $application->id,
|
|
||||||
'is_preview' => false,
|
|
||||||
], [
|
|
||||||
'value' => $value,
|
|
||||||
'is_build_time' => false,
|
|
||||||
'is_preview' => false,
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ray($environment);
|
|
||||||
$environment = $application->environment_variables()->where('application_id', $application->id)->get()->mapWithKeys(function ($item) {
|
|
||||||
return [$item['key'] => $item['value']];
|
|
||||||
});
|
|
||||||
|
|
||||||
// if ($environment?->count() > 0) {
|
|
||||||
// $environment = $environment->map(function ($value, $key) use ($application) {
|
|
||||||
// $found = $application->environment_variables()->where('key', $key)->where('application_id', $application->id)->first();
|
|
||||||
// if ($found) {
|
|
||||||
// $value = $found->value;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// return $value;
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
|
|
||||||
// Labels
|
// Labels
|
||||||
$fqdns = collect([]);
|
$fqdns = collect([]);
|
||||||
if ($application?->serviceType()) {
|
if ($application?->serviceType()) {
|
||||||
|
|||||||
@@ -254,7 +254,7 @@
|
|||||||
helper="You need to modify the docker compose file." monacoEditorLanguage="yaml"
|
helper="You need to modify the docker compose file." monacoEditorLanguage="yaml"
|
||||||
useMonacoEditor />
|
useMonacoEditor />
|
||||||
@else
|
@else
|
||||||
@if (isDev())
|
@if ($application->compose_parsing_version === '3')
|
||||||
<x-forms.textarea rows="10" readonly id="application.docker_compose_raw"
|
<x-forms.textarea rows="10" readonly id="application.docker_compose_raw"
|
||||||
label="Docker Compose Content (raw)" helper="You need to modify the docker compose file."
|
label="Docker Compose Content (raw)" helper="You need to modify the docker compose file."
|
||||||
monacoEditorLanguage="yaml" useMonacoEditor />
|
monacoEditorLanguage="yaml" useMonacoEditor />
|
||||||
|
|||||||
Reference in New Issue
Block a user