mirror of
https://github.com/cupcakearmy/coolify.git
synced 2024-10-22 08:04:19 +02:00
feat: add coolify build env variables to building phase
This commit is contained in:
parent
301a3596e8
commit
5e4eb7dead
@ -113,6 +113,8 @@ class ApplicationDeploymentJob implements ShouldBeEncrypted, ShouldQueue
|
|||||||
|
|
||||||
private $env_args;
|
private $env_args;
|
||||||
|
|
||||||
|
private $environment_variables;
|
||||||
|
|
||||||
private $env_nixpacks_args;
|
private $env_nixpacks_args;
|
||||||
|
|
||||||
private $docker_compose;
|
private $docker_compose;
|
||||||
@ -1059,6 +1061,7 @@ private function save_environment_variables()
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$this->environment_variables = $envs;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function laravel_finetunes()
|
private function laravel_finetunes()
|
||||||
@ -1929,6 +1932,15 @@ private function pull_latest_image($image)
|
|||||||
|
|
||||||
private function build_image()
|
private function build_image()
|
||||||
{
|
{
|
||||||
|
// Add Coolify related variables to the build args
|
||||||
|
$this->environment_variables->filter(function ($key, $value) {
|
||||||
|
return str($key)->startsWith('COOLIFY_');
|
||||||
|
})->each(function ($key, $value) {
|
||||||
|
$this->build_args->push("--build-arg '{$key}'");
|
||||||
|
});
|
||||||
|
|
||||||
|
$this->build_args = $this->build_args->implode(' ');
|
||||||
|
|
||||||
$this->application_deployment_queue->addLogEntry('----------------------------------------');
|
$this->application_deployment_queue->addLogEntry('----------------------------------------');
|
||||||
if ($this->application->build_pack === 'static') {
|
if ($this->application->build_pack === 'static') {
|
||||||
$this->application_deployment_queue->addLogEntry('Static deployment. Copying static assets to the image.');
|
$this->application_deployment_queue->addLogEntry('Static deployment. Copying static assets to the image.');
|
||||||
@ -2214,9 +2226,6 @@ private function generate_build_env_variables()
|
|||||||
$this->build_args->push("--build-arg {$env->key}={$value}");
|
$this->build_args->push("--build-arg {$env->key}={$value}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->build_args = $this->build_args->implode(' ');
|
|
||||||
ray($this->build_args);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function add_build_env_variables_to_dockerfile()
|
private function add_build_env_variables_to_dockerfile()
|
||||||
|
Loading…
Reference in New Issue
Block a user