diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2018-03-14 10:05:06 +0100 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2018-03-14 10:05:06 +0100 |
commit | e7e06566e150af8ecc54c67bd6f5cd5b86c99628 (patch) | |
tree | 11ab4aa1d7aafa4c1023fdbb0e13e89fd1125fb9 | |
parent | d5789d4e2396716783520a695f756a58c3788175 (diff) | |
download | gitlab-ce-e7e06566e150af8ecc54c67bd6f5cd5b86c99628.tar.gz |
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.
-rw-r--r-- | app/models/ci/build.rb | 2 | ||||
-rw-r--r-- | app/models/project.rb | 6 |
2 files changed, 3 insertions, 5 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index ef1e1e08fba..f8a3600e863 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -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 diff --git a/app/models/project.rb b/app/models/project.rb index e307d384e74..87d228997be 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -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 |