diff options
author | Matija Čupić <matteeyah@gmail.com> | 2018-09-07 22:33:06 +0300 |
---|---|---|
committer | Matija Čupić <matteeyah@gmail.com> | 2018-09-07 22:33:06 +0300 |
commit | eca73d2b30a62876a3148bd1a8b1dfd6d48977fe (patch) | |
tree | 3577594e28eeaf0fd0c78f8946b7d49884f33fb9 /lib/gitlab/ci/config.rb | |
parent | 95b296f8ac8578e142efd6a60a582be4da5b09be (diff) |
Address MR comments
CE mirror of 1269dc47b7f8d1a9913de326c9bd356d3e603663
Diffstat (limited to 'lib/gitlab/ci/config.rb')
-rw-r--r-- | lib/gitlab/ci/config.rb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/gitlab/ci/config.rb b/lib/gitlab/ci/config.rb index caa3a7c3c86..4a0d67720a9 100644 --- a/lib/gitlab/ci/config.rb +++ b/lib/gitlab/ci/config.rb @@ -7,17 +7,10 @@ module Gitlab ConfigError = Class.new(StandardError) def initialize(config, project = nil, opts = {}) - initial_config = Config::Extendable + @config = Config::Extendable .new(build_config(config, opts)) .to_hash - if project.present? - processor = ::Gitlab::Ci::ExternalFiles::Processor.new(initial_config, project) - @config = processor.perform - else - @config = initial_config - end - @global = Entry::Global.new(@config) @global.compose! rescue Loader::FormatError, Extendable::ExtensionError => e @@ -72,8 +65,15 @@ module Gitlab end # 'opts' argument is used in EE see /ee/lib/ee/gitlab/ci/config.rb - def build_config(config, opts = {}) - Loader.new(config).load! + def build_config(config, project, opts = {}) + initial_config = Loader.new(config).load! + + if project.present? + processor = ::Gitlab::Ci::ExternalFiles::Processor.new(initial_config, project) + processor.perform + else + initial_config + end end end end |