diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2019-04-03 23:51:00 +0300 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2019-04-05 11:13:49 +0300 |
commit | e0df05cfbc7f03e8fce27c5e93fda17f634721e7 (patch) | |
tree | f0e04117e15e4fe3ea3502c72261dd1aed51e7d8 /lib/gitlab/ci/config.rb | |
parent | 6d000c9f9cbc65f92ed27ea55a14e5de9b11320d (diff) |
Require all templates to use default stages
Our templates are free to override the 'stages:'.
However, they should follow the convention to always include
'build', 'test', 'deploy' which are defaults when not defined.
Diffstat (limited to 'lib/gitlab/ci/config.rb')
-rw-r--r-- | lib/gitlab/ci/config.rb | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/gitlab/ci/config.rb b/lib/gitlab/ci/config.rb index 15643fa03ac..f187e456993 100644 --- a/lib/gitlab/ci/config.rb +++ b/lib/gitlab/ci/config.rb @@ -73,17 +73,13 @@ module Gitlab def build_config(config, project:, sha:, user:) initial_config = Gitlab::Config::Loader::Yaml.new(config).load! - if project - process_external_files(initial_config, project: project, sha: sha, user: user) - else - initial_config - end + process_external_files(initial_config, project: project, sha: sha, user: user) end def process_external_files(config, project:, sha:, user:) Config::External::Processor.new(config, project: project, - sha: sha || project.repository.root_ref_sha, + sha: sha || project&.repository&.root_ref_sha, user: user, expandset: Set.new).perform end |