gitlab-org--gitlab-foss/lib/gitlab/template/gitlab_ci_yml_template.rb

46 lines
1.1 KiB
Ruby
Raw Normal View History

# frozen_string_literal: true
module Gitlab
module Template
class GitlabCiYmlTemplate < BaseTemplate
2016-06-17 06:37:19 +00:00
def content
explanation = "# This file is a template, and might need editing before it works on your project."
[explanation, super].join("\n")
end
class << self
def extension
'.gitlab-ci.yml'
end
def categories
{
'General' => '',
'Pages' => 'Pages',
'Verify' => 'Verify',
2016-12-23 10:08:09 +00:00
'Auto deploy' => 'autodeploy'
}
end
def disabled_templates
%w[
Verify/Browser-Performance
]
end
def base_dir
2018-09-26 15:39:27 +00:00
Rails.root.join('lib/gitlab/ci/templates')
end
def finder(project = nil)
Gitlab::Template::Finders::GlobalTemplateFinder.new(
self.base_dir, self.extension, self.categories, exclusions: self.disabled_templates
)
end
end
end
end
end
Gitlab::Template::GitlabCiYmlTemplate.prepend_if_ee('::EE::Gitlab::Template::GitlabCiYmlTemplate')