Class: Gitlab::Ci::ProjectConfig::ProjectSetting

Inherits:
Source
  • Object
show all
Extended by:
Utils::Override
Defined in:
lib/gitlab/ci/project_config/project_setting.rb

Instance Attribute Summary

Attributes inherited from Source

#pipeline_policy_context

Instance Method Summary collapse

Methods included from Utils::Override

extended, extensions, included, method_added, override, prepended, queue_verification, verify!

Methods inherited from Source

#exists?, #initialize

Constructor Details

This class inherits a constructor from Gitlab::Ci::ProjectConfig::Source

Instance Method Details

#contentObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/gitlab/ci/project_config/project_setting.rb', line 9

def content
  case source
  when :repository_source
    ci_yaml_include({ 'local' => ci_config_path })
  when :external_project_source
    path_file, path_project, ref = extract_location_tokens

    config_location = { 'project' => path_project, 'file' => path_file }
    config_location['ref'] = ref if ref.present?

    ci_yaml_include(config_location)
  when :remote_source
    ci_yaml_include({ 'remote' => ci_config_path })
  end
end

#internal_include_prepended?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/gitlab/ci/project_config/project_setting.rb', line 26

def internal_include_prepended?
  true
end

#sourceObject



30
31
32
33
34
35
36
37
38
# File 'lib/gitlab/ci/project_config/project_setting.rb', line 30

def source
  if remote_config_path?
    :remote_source
  elsif external_project_path?
    :external_project_source
  elsif file_in_repository?
    :repository_source
  end
end

#urlObject



42
43
44
45
46
# File 'lib/gitlab/ci/project_config/project_setting.rb', line 42

def url
  return unless source == :repository_source

  File.join(Settings.build_ci_server_fqdn, project.full_path, '//', ci_config_path)
end