Class: Datadog::CI::Ext::Environment::Providers::Circleci
- Inherits:
-
Base
- Object
- Base
- Datadog::CI::Ext::Environment::Providers::Circleci
show all
- Defined in:
- lib/datadog/ci/ext/environment/providers/circleci.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_author_date, #git_commit_committer_date, #git_commit_committer_email, #git_commit_committer_name, #initialize, #node_labels, #node_name, #pipeline_number, #stage_name
Class Method Details
.handles?(env) ⇒ Boolean
15
16
17
|
# File 'lib/datadog/ci/ext/environment/providers/circleci.rb', line 15
def self.handles?(env)
env.key?("CIRCLECI")
end
|
Instance Method Details
#ci_env_vars ⇒ Object
75
76
77
78
79
80
|
# File 'lib/datadog/ci/ext/environment/providers/circleci.rb', line 75
def ci_env_vars
{
"CIRCLE_WORKFLOW_ID" => env["CIRCLE_WORKFLOW_ID"],
"CIRCLE_BUILD_NUM" => env["CIRCLE_BUILD_NUM"]
}.to_json
end
|
#git_branch ⇒ Object
55
56
57
|
# File 'lib/datadog/ci/ext/environment/providers/circleci.rb', line 55
def git_branch
env["CIRCLE_BRANCH"]
end
|
#git_commit_author_email ⇒ Object
67
68
69
|
# File 'lib/datadog/ci/ext/environment/providers/circleci.rb', line 67
def git_commit_author_email
env["BUILD_REQUESTEDFOREMAIL"]
end
|
#git_commit_author_name ⇒ Object
63
64
65
|
# File 'lib/datadog/ci/ext/environment/providers/circleci.rb', line 63
def git_commit_author_name
env["BUILD_REQUESTEDFORID"]
end
|
#git_commit_message ⇒ Object
71
72
73
|
# File 'lib/datadog/ci/ext/environment/providers/circleci.rb', line 71
def git_commit_message
env["BUILD_SOURCEVERSIONMESSAGE"]
end
|
#git_commit_sha ⇒ Object
51
52
53
|
# File 'lib/datadog/ci/ext/environment/providers/circleci.rb', line 51
def git_commit_sha
env["CIRCLE_SHA1"]
end
|
#git_repository_url ⇒ Object
47
48
49
|
# File 'lib/datadog/ci/ext/environment/providers/circleci.rb', line 47
def git_repository_url
env["CIRCLE_REPOSITORY_URL"]
end
|
#git_tag ⇒ Object
59
60
61
|
# File 'lib/datadog/ci/ext/environment/providers/circleci.rb', line 59
def git_tag
env["CIRCLE_TAG"]
end
|
#job_name ⇒ Object
27
28
29
|
# File 'lib/datadog/ci/ext/environment/providers/circleci.rb', line 27
def job_name
env["CIRCLE_JOB"]
end
|
#job_url ⇒ Object
23
24
25
|
# File 'lib/datadog/ci/ext/environment/providers/circleci.rb', line 23
def job_url
env["CIRCLE_BUILD_URL"]
end
|
#pipeline_id ⇒ Object
31
32
33
|
# File 'lib/datadog/ci/ext/environment/providers/circleci.rb', line 31
def pipeline_id
env["CIRCLE_WORKFLOW_ID"]
end
|
#pipeline_name ⇒ Object
35
36
37
|
# File 'lib/datadog/ci/ext/environment/providers/circleci.rb', line 35
def pipeline_name
env["CIRCLE_PROJECT_REPONAME"]
end
|
#pipeline_url ⇒ Object
39
40
41
|
# File 'lib/datadog/ci/ext/environment/providers/circleci.rb', line 39
def pipeline_url
"https://app.circleci.com/pipelines/workflows/#{env["CIRCLE_WORKFLOW_ID"]}"
end
|
#provider_name ⇒ Object
19
20
21
|
# File 'lib/datadog/ci/ext/environment/providers/circleci.rb', line 19
def provider_name
Provider::CIRCLECI
end
|
#workspace_path ⇒ Object
43
44
45
|
# File 'lib/datadog/ci/ext/environment/providers/circleci.rb', line 43
def workspace_path
env["CIRCLE_WORKING_DIRECTORY"]
end
|