Class: Gitlab::Template::GitlabCiYmlTemplate
Constant Summary
collapse
- BASE_EXCLUDED_PATTERNS =
[%r{\.latest\.}].freeze
- BASE_DIR =
'lib/gitlab/ci/templates'
Instance Attribute Summary
Attributes inherited from BaseTemplate
#category
Class Method Summary
collapse
Instance Method Summary
collapse
extended, extensions, included, method_added, override, prepended, queue_verification, verify!
#<=>, all, by_category, category_directory, #content, find, #full_name, #initialize, #name, #project_id, repository_template_names, #resolve!, template_names_by_category, template_subsets, #to_json
Class Method Details
.additional_excluded_patterns ⇒ Object
42
43
44
|
# File 'lib/gitlab/template/gitlab_ci_yml_template.rb', line 42
def additional_excluded_patterns
[%r{Verify/Browser-Performance}]
end
|
.base_dir ⇒ Object
46
47
48
|
# File 'lib/gitlab/template/gitlab_ci_yml_template.rb', line 46
def base_dir
Rails.root.join(BASE_DIR)
end
|
.categories ⇒ Object
21
22
23
24
25
26
27
28
|
# File 'lib/gitlab/template/gitlab_ci_yml_template.rb', line 21
def categories
{
'General' => '',
'Pages' => 'Pages',
'Verify' => 'Verify',
'Auto deploy' => 'autodeploy'
}
end
|
.excluded_patterns ⇒ Object
36
37
38
39
40
|
# File 'lib/gitlab/template/gitlab_ci_yml_template.rb', line 36
def excluded_patterns
strong_memoize(:excluded_patterns) do
BASE_EXCLUDED_PATTERNS + additional_excluded_patterns
end
end
|
.extension ⇒ Object
17
18
19
|
# File 'lib/gitlab/template/gitlab_ci_yml_template.rb', line 17
def extension
'.gitlab-ci.yml'
end
|
.finder(project = nil) ⇒ Object
50
51
52
53
54
55
56
57
58
|
# File 'lib/gitlab/template/gitlab_ci_yml_template.rb', line 50
def finder(project = nil)
Gitlab::Template::Finders::GlobalTemplateFinder.new(
self.base_dir,
self.extension,
self.categories,
self.include_categories_for_file,
excluded_patterns: self.excluded_patterns
)
end
|
.include_categories_for_file ⇒ Object
30
31
32
33
34
|
# File 'lib/gitlab/template/gitlab_ci_yml_template.rb', line 30
def include_categories_for_file
{
"SAST#{self.extension}" => { 'Security' => 'Security' }
}
end
|
Instance Method Details
#description ⇒ Object
9
10
11
|
# File 'lib/gitlab/template/gitlab_ci_yml_template.rb', line 9
def description
"# This file is a template, and might need editing before it works on your project."
end
|