Commit 56fb0e94 authored by Grzegorz Bizon's avatar Grzegorz Bizon
Browse files

Port deployment variables skeleton code from EE

This commit backports method signatures and related implementation to
the CE, to make CE and EE identical. This does not add any features from
EE, it is only aimed to reduce conflicts between CE and EE in the
future.
parent 2791ab9d9549
......@@ -257,7 +257,7 @@ def variables(environment: persisted_environment)
variables.concat(project.predefined_variables)
variables.concat(pipeline.predefined_variables)
variables.concat(runner.predefined_variables) if runner
variables.concat(project.deployment_variables) if has_environment?
variables.concat(project.deployment_variables(environment: environment)) if has_environment?
variables.concat(yaml_variables)
variables.concat(user_variables)
variables.concat(project.group.secret_variables_for(ref, project)) if project.group
......
......@@ -1616,10 +1616,8 @@ def protected_for?(ref)
end
end
def deployment_variables
return [] unless deployment_platform
deployment_platform.predefined_variables
def deployment_variables(environment: nil)
deployment_platform(environment: environment)&.predefined_variables || []
end
def auto_devops_variables
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment