Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-04-08 12:02:26 +0300
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-04-18 14:17:47 +0300
commita1363d39c6fe79d830dbce468c02880d2a5d7996 (patch)
tree62dff2b35c5032f896ab8414f21982e200fa49ca /app/models/ci/build.rb
parente32fc7567be2ff2cc995648e675de18133f8a066 (diff)
Add `variables` keyword to job in CI config YAML
Diffstat (limited to 'app/models/ci/build.rb')
-rw-r--r--app/models/ci/build.rb12
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 }