Class: Gitlab::Ci::Pipeline::Chain::Config::Content

Inherits:
Base
  • Object
show all
Includes:
Helpers
Defined in:
lib/gitlab/ci/pipeline/chain/config/content.rb,
lib/gitlab/ci/pipeline/chain/config/content/bridge.rb,
lib/gitlab/ci/pipeline/chain/config/content/remote.rb,
lib/gitlab/ci/pipeline/chain/config/content/source.rb,
lib/gitlab/ci/pipeline/chain/config/content/parameter.rb,
lib/gitlab/ci/pipeline/chain/config/content/repository.rb,
lib/gitlab/ci/pipeline/chain/config/content/auto_devops.rb,
lib/gitlab/ci/pipeline/chain/config/content/external_project.rb

Defined Under Namespace

Classes: AutoDevops, Bridge, ExternalProject, Parameter, Remote, Repository, Source

Constant Summary collapse

SOURCES =
[
  Gitlab::Ci::Pipeline::Chain::Config::Content::Parameter,
  Gitlab::Ci::Pipeline::Chain::Config::Content::Bridge,
  Gitlab::Ci::Pipeline::Chain::Config::Content::Repository,
  Gitlab::Ci::Pipeline::Chain::Config::Content::ExternalProject,
  Gitlab::Ci::Pipeline::Chain::Config::Content::Remote,
  Gitlab::Ci::Pipeline::Chain::Config::Content::AutoDevops
].freeze

Instance Attribute Summary

Attributes inherited from Base

#command, #config, #pipeline

Instance Method Summary collapse

Methods included from Helpers

#error, #persist_pipeline?, #warning

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Gitlab::Ci::Pipeline::Chain::Base

Instance Method Details

#break?Boolean

Returns:

  • (Boolean)

30
31
32
# File 'lib/gitlab/ci/pipeline/chain/config/content.rb', line 30

def break?
  @pipeline.errors.any? || @pipeline.persisted?
end

#perform!Object


20
21
22
23
24
25
26
27
28
# File 'lib/gitlab/ci/pipeline/chain/config/content.rb', line 20

def perform!
  if config = find_config
    @pipeline.build_pipeline_config(content: config.content)
    @command.config_content = config.content
    @pipeline.config_source = config.source
  else
    error('Missing CI config file')
  end
end