diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-04-08 11:02:26 +0200 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-04-18 13:17:47 +0200 |
commit | a1363d39c6fe79d830dbce468c02880d2a5d7996 (patch) | |
tree | 62dff2b35c5032f896ab8414f21982e200fa49ca /app | |
parent | e32fc7567be2ff2cc995648e675de18133f8a066 (diff) | |
download | gitlab-ce-a1363d39c6fe79d830dbce468c02880d2a5d7996.tar.gz |
Add `variables` keyword to job in CI config YAML
Diffstat (limited to 'app')
-rw-r--r-- | app/models/ci/build.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index 7d33838044b..89a9eb76331 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -365,9 +365,11 @@ module Ci self.update(erased_by: user, erased_at: Time.now) end - private - def yaml_variables + global_yaml_variables + job_yaml_variables + end + + def global_yaml_variables if commit.config_processor commit.config_processor.variables.map do |key, value| { key: key, value: value, public: true } @@ -377,6 +379,12 @@ module Ci end end + def job_yaml_variables + options[:variables].to_h.map do |key, value| + { key: key, value: value, public: true } + end + end + def project_variables project.variables.map do |variable| { key: variable.key, value: variable.value, public: false } |