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.
This commit is contained in:
Grzegorz Bizon 2018-03-14 10:05:06 +01:00
parent d5789d4e23
commit e7e06566e1
2 changed files with 3 additions and 5 deletions

View File

@ -257,7 +257,7 @@ module Ci
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

View File

@ -1616,10 +1616,8 @@ class Project < ActiveRecord::Base
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