fix(core): update environment variable generation logic in ApplicationDeploymentJob to handle different build packs

This commit is contained in:
Andras Bacsai
2025-01-22 15:13:40 +01:00
parent bae8b9a938
commit c3c032ebbd

View File

@@ -2288,8 +2288,12 @@ COPY ./nginx.conf /etc/nginx/conf.d/default.conf");
private function generate_build_env_variables()
{
$variables = collect($this->nixpacks_plan_json->get('variables'));
$variables->put('SOURCE_COMMIT', $this->commit);
if ($this->application->build_pack === 'nixpacks') {
$variables = collect($this->nixpacks_plan_json->get('variables'));
} else {
$this->generate_env_variables();
$variables = collect([])->merge($this->env_args);
}
$this->build_args = $variables->map(function ($value, $key) {
$value = escapeshellarg($value);