diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2016-04-18 12:28:19 +0000 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2016-04-18 12:28:19 +0000 |
commit | 06952aaf24633550f57fd54b70d27732509935c2 (patch) | |
tree | 08245bdf4c9ba3469d8bd20b4f617b4acd0f79dd /app | |
parent | 2b8fc1387b97dc8ae7857458cc61c6f7a21f6d54 (diff) | |
parent | 1339fda1cd3325c0186b5f1b53444e7319ad3cb6 (diff) | |
download | gitlab-ce-06952aaf24633550f57fd54b70d27732509935c2.tar.gz |
Merge branch 'feature/ci-job-env-variables' into 'master'
Add environment variables on a job level in CI
Make it possible to define environment variables on a job level.
Closes #14716
See merge request !3612
Diffstat (limited to 'app')
-rw-r--r-- | app/models/ci/build.rb | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index 7d33838044b..85ef0523b31 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -365,11 +365,23 @@ 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.global_variables.map do |key, value| + { key: key, value: value, public: true } + end + else + [] + end + end + + def job_yaml_variables if commit.config_processor - commit.config_processor.variables.map do |key, value| + commit.config_processor.job_variables(name).map do |key, value| { key: key, value: value, public: true } end else |