summaryrefslogtreecommitdiff
path: root/lib/gitlab/ci/project_config/auto_devops.rb
blob: 70f8c7b9bb3f2385c6bf2dc13f3c8325e66ed6cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# frozen_string_literal: true

module Gitlab
  module Ci
    class ProjectConfig
      class AutoDevops < Source
        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

        def contains_internal_include?
          true
        end

        def source
          :auto_devops_source
        end

        private

        def template_name
          'Auto-DevOps'
        end
      end
    end
  end
end