Class: Datadog::CI::Ext::Environment::Providers::Gitlab
- Inherits:
-
Base
- Object
- Base
- Datadog::CI::Ext::Environment::Providers::Gitlab
show all
- Defined in:
- lib/datadog/ci/ext/environment/providers/gitlab.rb
Overview
Instance Attribute Summary
Attributes inherited from Base
#env
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
#additional_tags, #git_branch_or_tag, #git_commit_committer_date, #git_commit_committer_email, #git_commit_committer_name, #initialize
Class Method Details
.handles?(env) ⇒ Boolean
13
14
15
|
# File 'lib/datadog/ci/ext/environment/providers/gitlab.rb', line 13
def self.handles?(env)
env.key?("GITLAB_CI")
end
|
Instance Method Details
#ci_env_vars ⇒ Object
95
96
97
98
99
100
101
|
# File 'lib/datadog/ci/ext/environment/providers/gitlab.rb', line 95
def ci_env_vars
{
"CI_PROJECT_URL" => env["CI_PROJECT_URL"],
"CI_PIPELINE_ID" => env["CI_PIPELINE_ID"],
"CI_JOB_ID" => env["CI_JOB_ID"]
}.to_json
end
|
#git_branch ⇒ Object
69
70
71
|
# File 'lib/datadog/ci/ext/environment/providers/gitlab.rb', line 69
def git_branch
env["CI_COMMIT_REF_NAME"]
end
|
#git_commit_author_date ⇒ Object
87
88
89
|
# File 'lib/datadog/ci/ext/environment/providers/gitlab.rb', line 87
def git_commit_author_date
env["CI_COMMIT_TIMESTAMP"]
end
|
#git_commit_author_email ⇒ Object
82
83
84
85
|
# File 'lib/datadog/ci/ext/environment/providers/gitlab.rb', line 82
def git_commit_author_email
_name, email =
email
end
|
#git_commit_author_name ⇒ Object
77
78
79
80
|
# File 'lib/datadog/ci/ext/environment/providers/gitlab.rb', line 77
def git_commit_author_name
name, _email =
name
end
|
#git_commit_message ⇒ Object
91
92
93
|
# File 'lib/datadog/ci/ext/environment/providers/gitlab.rb', line 91
def git_commit_message
env["CI_COMMIT_MESSAGE"]
end
|
#git_commit_sha ⇒ Object
65
66
67
|
# File 'lib/datadog/ci/ext/environment/providers/gitlab.rb', line 65
def git_commit_sha
env["CI_COMMIT_SHA"]
end
|
#git_repository_url ⇒ Object
61
62
63
|
# File 'lib/datadog/ci/ext/environment/providers/gitlab.rb', line 61
def git_repository_url
env["CI_REPOSITORY_URL"]
end
|
#git_tag ⇒ Object
73
74
75
|
# File 'lib/datadog/ci/ext/environment/providers/gitlab.rb', line 73
def git_tag
env["CI_COMMIT_TAG"]
end
|
#job_name ⇒ Object
21
22
23
|
# File 'lib/datadog/ci/ext/environment/providers/gitlab.rb', line 21
def job_name
env["CI_JOB_NAME"]
end
|
#job_url ⇒ Object
25
26
27
|
# File 'lib/datadog/ci/ext/environment/providers/gitlab.rb', line 25
def job_url
env["CI_JOB_URL"]
end
|
#node_labels ⇒ Object
57
58
59
|
# File 'lib/datadog/ci/ext/environment/providers/gitlab.rb', line 57
def node_labels
env["CI_RUNNER_TAGS"]
end
|
#node_name ⇒ Object
53
54
55
|
# File 'lib/datadog/ci/ext/environment/providers/gitlab.rb', line 53
def node_name
env["CI_RUNNER_ID"]
end
|
#pipeline_id ⇒ Object
29
30
31
|
# File 'lib/datadog/ci/ext/environment/providers/gitlab.rb', line 29
def pipeline_id
env["CI_PIPELINE_ID"]
end
|
#pipeline_name ⇒ Object
33
34
35
|
# File 'lib/datadog/ci/ext/environment/providers/gitlab.rb', line 33
def pipeline_name
env["CI_PROJECT_PATH"]
end
|
#pipeline_number ⇒ Object
37
38
39
|
# File 'lib/datadog/ci/ext/environment/providers/gitlab.rb', line 37
def pipeline_number
env["CI_PIPELINE_IID"]
end
|
#pipeline_url ⇒ Object
41
42
43
|
# File 'lib/datadog/ci/ext/environment/providers/gitlab.rb', line 41
def pipeline_url
env["CI_PIPELINE_URL"]
end
|
#provider_name ⇒ Object
17
18
19
|
# File 'lib/datadog/ci/ext/environment/providers/gitlab.rb', line 17
def provider_name
Provider::GITLAB
end
|
#stage_name ⇒ Object
45
46
47
|
# File 'lib/datadog/ci/ext/environment/providers/gitlab.rb', line 45
def stage_name
env["CI_JOB_STAGE"]
end
|
#workspace_path ⇒ Object
49
50
51
|
# File 'lib/datadog/ci/ext/environment/providers/gitlab.rb', line 49
def workspace_path
env["CI_PROJECT_DIR"]
end
|