Class: Gitlab::Template::GitlabCiYmlTemplate
Constant Summary
collapse
- BASE_EXCLUDED_PATTERNS =
[%r{\.latest$}].freeze
Instance Attribute Summary
Attributes inherited from BaseTemplate
#category
Class Method Summary
collapse
Instance Method Summary
collapse
clear_memoization, strong_memoize, strong_memoized?
#<=>, all, by_category, category_directory, dropdown_names, find, #full_name, #initialize, #name, #resolve!, #to_json
Class Method Details
.additional_excluded_patterns ⇒ Object
35
36
37
|
# File 'lib/gitlab/template/gitlab_ci_yml_template.rb', line 35
def additional_excluded_patterns
[%r{Verify/Browser-Performance}]
end
|
.base_dir ⇒ Object
39
40
41
|
# File 'lib/gitlab/template/gitlab_ci_yml_template.rb', line 39
def base_dir
Rails.root.join('lib/gitlab/ci/templates')
end
|
.categories ⇒ Object
20
21
22
23
24
25
26
27
|
# File 'lib/gitlab/template/gitlab_ci_yml_template.rb', line 20
def categories
{
'General' => '',
'Pages' => 'Pages',
'Verify' => 'Verify',
'Auto deploy' => 'autodeploy'
}
end
|
.excluded_patterns ⇒ Object
29
30
31
32
33
|
# File 'lib/gitlab/template/gitlab_ci_yml_template.rb', line 29
def excluded_patterns
strong_memoize(:excluded_patterns) do
BASE_EXCLUDED_PATTERNS + additional_excluded_patterns
end
end
|
.extension ⇒ Object
16
17
18
|
# File 'lib/gitlab/template/gitlab_ci_yml_template.rb', line 16
def extension
'.gitlab-ci.yml'
end
|
.finder(project = nil) ⇒ Object
43
44
45
46
47
|
# File 'lib/gitlab/template/gitlab_ci_yml_template.rb', line 43
def finder(project = nil)
Gitlab::Template::Finders::GlobalTemplateFinder.new(
self.base_dir, self.extension, self.categories, excluded_patterns: self.excluded_patterns
)
end
|
Instance Method Details
#content ⇒ Object
8
9
10
11
|
# File 'lib/gitlab/template/gitlab_ci_yml_template.rb', line 8
def content
explanation = "# This file is a template, and might need editing before it works on your project."
[explanation, super].join("\n")
end
|