BigW Consortium Gitlab

gitlab_ci_yml_template.rb 723 Bytes
Newer Older
1 2
module Gitlab
  module Template
3
    class GitlabCiYmlTemplate < BaseTemplate
4 5 6 7 8
      def content
        explanation = "# This file is a template, and might need editing before it works on your project."
        [explanation, super].join("\n")
      end

9 10 11 12 13 14 15 16
      class << self
        def extension
          '.gitlab-ci.yml'
        end

        def categories
          {
            "General" => '',
17
            "Pages" => 'Pages'
18 19 20 21 22 23
          }
        end

        def base_dir
          Rails.root.join('vendor/gitlab-ci-yml')
        end
24 25 26 27

        def finder(project = nil)
          Gitlab::Template::Finders::GlobalTemplateFinder.new(self.base_dir, self.extension, self.categories)
        end
28 29 30 31
      end
    end
  end
end