fix: handle array env vars
This commit is contained in:
@@ -1058,20 +1058,15 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
|
|||||||
data_set($service, 'volumes', $serviceVolumes->toArray());
|
data_set($service, 'volumes', $serviceVolumes->toArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add env_file with at least .env to the service
|
|
||||||
// $envFile = collect(data_get($service, 'env_file', []));
|
|
||||||
// if ($envFile->count() > 0) {
|
|
||||||
// if (!$envFile->contains('.env')) {
|
|
||||||
// $envFile->push('.env');
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// $envFile = collect(['.env']);
|
|
||||||
// }
|
|
||||||
// data_set($service, 'env_file', $envFile->toArray());
|
|
||||||
|
|
||||||
// Get variables from the service
|
// Get variables from the service
|
||||||
foreach ($serviceVariables as $variableName => $variable) {
|
foreach ($serviceVariables as $variableName => $variable) {
|
||||||
if (is_numeric($variableName)) {
|
if (is_numeric($variableName)) {
|
||||||
|
if (is_array($variable)) {
|
||||||
|
// - SESSION_SECRET: 123
|
||||||
|
// - SESSION_SECRET:
|
||||||
|
$key = str(collect($variable)->keys()->first());
|
||||||
|
$value = str(collect($variable)->values()->first());
|
||||||
|
} else {
|
||||||
$variable = str($variable);
|
$variable = str($variable);
|
||||||
if ($variable->contains('=')) {
|
if ($variable->contains('=')) {
|
||||||
// - SESSION_SECRET=123
|
// - SESSION_SECRET=123
|
||||||
@@ -1083,6 +1078,7 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
|
|||||||
$key = $variable;
|
$key = $variable;
|
||||||
$value = null;
|
$value = null;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// SESSION_SECRET: 123
|
// SESSION_SECRET: 123
|
||||||
// SESSION_SECRET:
|
// SESSION_SECRET:
|
||||||
@@ -1837,6 +1833,12 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
|
|||||||
// Get variables from the service
|
// Get variables from the service
|
||||||
foreach ($serviceVariables as $variableName => $variable) {
|
foreach ($serviceVariables as $variableName => $variable) {
|
||||||
if (is_numeric($variableName)) {
|
if (is_numeric($variableName)) {
|
||||||
|
if (is_array($variable)) {
|
||||||
|
// - SESSION_SECRET: 123
|
||||||
|
// - SESSION_SECRET:
|
||||||
|
$key = str(collect($variable)->keys()->first());
|
||||||
|
$value = str(collect($variable)->values()->first());
|
||||||
|
} else {
|
||||||
$variable = str($variable);
|
$variable = str($variable);
|
||||||
if ($variable->contains('=')) {
|
if ($variable->contains('=')) {
|
||||||
// - SESSION_SECRET=123
|
// - SESSION_SECRET=123
|
||||||
@@ -1848,6 +1850,7 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
|
|||||||
$key = $variable;
|
$key = $variable;
|
||||||
$value = null;
|
$value = null;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// SESSION_SECRET: 123
|
// SESSION_SECRET: 123
|
||||||
// SESSION_SECRET:
|
// SESSION_SECRET:
|
||||||
|
|||||||
Reference in New Issue
Block a user