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

Inherits:
Source
  • Object
show all
Defined in:
lib/gitlab/ci/pipeline/chain/config/content/auto_devops.rb

Constant Summary

Constants inherited from Source

Source::DEFAULT_YAML_FILE

Instance Attribute Summary

Attributes inherited from Source

#command

Instance Method Summary collapse

Methods inherited from Source

#ci_config_path, #exists?, #initialize, #project

Methods included from Utils::StrongMemoize

#clear_memoization, #strong_memoize, #strong_memoized?

Constructor Details

This class inherits a constructor from Gitlab::Ci::Pipeline::Chain::Config::Content::Source

Instance Method Details

#contentObject


10
11
12
13
14
15
16
17
# File 'lib/gitlab/ci/pipeline/chain/config/content/auto_devops.rb', line 10

def content
  strong_memoize(:content) do
    next unless project&.auto_devops_enabled?

    template = Gitlab::Template::GitlabCiYmlTemplate.find(template_name)
    YAML.dump('include' => [{ 'template' => template.full_name }])
  end
end

#sourceObject


19
20
21
# File 'lib/gitlab/ci/pipeline/chain/config/content/auto_devops.rb', line 19

def source
  :auto_devops_source
end