Merge pull request #6691 from coollabsio/next
fix(deployment-job): enhance build time variable analysis
This commit is contained in:
commit
8fa0ba9539
1 changed files with 21 additions and 1 deletions
|
|
@ -2715,7 +2715,27 @@ private function start_by_compose_file()
|
|||
|
||||
private function analyzeBuildTimeVariables($variables)
|
||||
{
|
||||
$variablesArray = $variables->toArray();
|
||||
$userDefinedVariables = collect([]);
|
||||
|
||||
$dbVariables = $this->pull_request_id === 0
|
||||
? $this->application->environment_variables()
|
||||
->where('is_buildtime', true)
|
||||
->pluck('key')
|
||||
: $this->application->environment_variables_preview()
|
||||
->where('is_buildtime', true)
|
||||
->pluck('key');
|
||||
|
||||
foreach ($variables as $key => $value) {
|
||||
if ($dbVariables->contains($key)) {
|
||||
$userDefinedVariables->put($key, $value);
|
||||
}
|
||||
}
|
||||
|
||||
if ($userDefinedVariables->isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$variablesArray = $userDefinedVariables->toArray();
|
||||
$warnings = self::analyzeBuildVariables($variablesArray);
|
||||
|
||||
if (empty($warnings)) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue