diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-04-15 12:18:46 +0200 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-04-18 13:17:48 +0200 |
commit | b7946b50fc1b23b1974f7d0306c06f6d92cc8466 (patch) | |
tree | 8f2f9980b6bf28b8d48d4ad4e7a04e983e52cbba /lib/ci | |
parent | b578fbfb8572860490cdfd0163bfbf5f999bb1e6 (diff) | |
download | gitlab-ce-b7946b50fc1b23b1974f7d0306c06f6d92cc8466.tar.gz |
Read job variables directly from gitlab CI config
Diffstat (limited to 'lib/ci')
-rw-r--r-- | lib/ci/gitlab_ci_yaml_processor.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/ci/gitlab_ci_yaml_processor.rb b/lib/ci/gitlab_ci_yaml_processor.rb index 712dc4492c5..548c6250e04 100644 --- a/lib/ci/gitlab_ci_yaml_processor.rb +++ b/lib/ci/gitlab_ci_yaml_processor.rb @@ -9,7 +9,7 @@ module Ci :allow_failure, :type, :stage, :when, :artifacts, :cache, :dependencies, :variables] - attr_reader :before_script, :image, :services, :variables, :path, :cache + attr_reader :before_script, :image, :services, :path, :cache def initialize(config, path = nil) @config = YAML.safe_load(config, [Symbol], [], true) @@ -40,6 +40,15 @@ module Ci @stages || DEFAULT_STAGES end + def variables + @variables + end + + def job_variables(name) + job = @jobs[name.to_sym] + job ? job[:variables] : [] + end + private def initial_parsing @@ -85,7 +94,6 @@ module Ci artifacts: job[:artifacts], cache: job[:cache] || @cache, dependencies: job[:dependencies], - variables: job[:variables], }.compact } end |