Class: Datadog::CI::Ext::Environment::Providers::Azure
- Inherits:
-
Base
- Object
- Base
- Datadog::CI::Ext::Environment::Providers::Azure
show all
- Defined in:
- lib/datadog/ci/ext/environment/providers/azure.rb
Overview
Instance Attribute Summary
Attributes inherited from Base
#env
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
#git_branch, #git_commit_author_date, #git_commit_committer_date, #git_commit_committer_email, #git_commit_committer_name, #git_commit_head_author_date, #git_commit_head_author_email, #git_commit_head_author_name, #git_commit_head_committer_date, #git_commit_head_committer_email, #git_commit_head_committer_name, #git_commit_head_message, #git_commit_head_sha, #git_pull_request_base_branch_head_sha, #git_pull_request_base_branch_sha, #git_tag, #initialize, #node_labels, #node_name
Class Method Details
.handles?(env) ⇒ Boolean
15
16
17
|
# File 'lib/datadog/ci/ext/environment/providers/azure.rb', line 15
def self.handles?(env)
env.key?("TF_BUILD")
end
|
Instance Method Details
#ci_env_vars ⇒ Object
95
96
97
98
99
100
101
|
# File 'lib/datadog/ci/ext/environment/providers/azure.rb', line 95
def ci_env_vars
{
"SYSTEM_TEAMPROJECTID" => env["SYSTEM_TEAMPROJECTID"],
"BUILD_BUILDID" => env["BUILD_BUILDID"],
"SYSTEM_JOBID" => env["SYSTEM_JOBID"]
}.to_json
end
|
#git_branch_or_tag ⇒ Object
71
72
73
|
# File 'lib/datadog/ci/ext/environment/providers/azure.rb', line 71
def git_branch_or_tag
env["SYSTEM_PULLREQUEST_SOURCEBRANCH"] || env["BUILD_SOURCEBRANCH"] || env["BUILD_SOURCEBRANCHNAME"]
end
|
#git_commit_author_email ⇒ Object
79
80
81
|
# File 'lib/datadog/ci/ext/environment/providers/azure.rb', line 79
def git_commit_author_email
env["BUILD_REQUESTEDFOREMAIL"]
end
|
#git_commit_author_name ⇒ Object
75
76
77
|
# File 'lib/datadog/ci/ext/environment/providers/azure.rb', line 75
def git_commit_author_name
env["BUILD_REQUESTEDFORID"]
end
|
#git_commit_message ⇒ Object
83
84
85
|
# File 'lib/datadog/ci/ext/environment/providers/azure.rb', line 83
def git_commit_message
env["BUILD_SOURCEVERSIONMESSAGE"]
end
|
#git_commit_sha ⇒ Object
67
68
69
|
# File 'lib/datadog/ci/ext/environment/providers/azure.rb', line 67
def git_commit_sha
env["SYSTEM_PULLREQUEST_SOURCECOMMITID"] || env["BUILD_SOURCEVERSION"]
end
|
#git_pull_request_base_branch ⇒ Object
87
88
89
|
# File 'lib/datadog/ci/ext/environment/providers/azure.rb', line 87
def git_pull_request_base_branch
env["SYSTEM_PULLREQUEST_TARGETBRANCH"]
end
|
#git_repository_url ⇒ Object
63
64
65
|
# File 'lib/datadog/ci/ext/environment/providers/azure.rb', line 63
def git_repository_url
env["SYSTEM_PULLREQUEST_SOURCEREPOSITORYURI"] || env["BUILD_REPOSITORY_URI"]
end
|
#job_id ⇒ Object
23
24
25
|
# File 'lib/datadog/ci/ext/environment/providers/azure.rb', line 23
def job_id
env["SYSTEM_JOBID"]
end
|
#job_name ⇒ Object
59
60
61
|
# File 'lib/datadog/ci/ext/environment/providers/azure.rb', line 59
def job_name
env["SYSTEM_JOBDISPLAYNAME"]
end
|
#job_url ⇒ Object
33
34
35
36
37
|
# File 'lib/datadog/ci/ext/environment/providers/azure.rb', line 33
def job_url
return unless url_defined?
@job_url ||= "#{pipeline_url}&view=logs&j=#{env["SYSTEM_JOBID"]}&t=#{env["SYSTEM_TASKINSTANCEID"]}"
end
|
#pipeline_id ⇒ Object
43
44
45
|
# File 'lib/datadog/ci/ext/environment/providers/azure.rb', line 43
def pipeline_id
build_id
end
|
#pipeline_name ⇒ Object
51
52
53
|
# File 'lib/datadog/ci/ext/environment/providers/azure.rb', line 51
def pipeline_name
env["BUILD_DEFINITIONNAME"]
end
|
#pipeline_number ⇒ Object
47
48
49
|
# File 'lib/datadog/ci/ext/environment/providers/azure.rb', line 47
def pipeline_number
build_id
end
|
#pipeline_url ⇒ Object
27
28
29
30
31
|
# File 'lib/datadog/ci/ext/environment/providers/azure.rb', line 27
def pipeline_url
return unless url_defined?
@pipeline_url ||= "#{team_foundation_server_uri}#{team_project_id}/_build/results?buildId=#{build_id}"
end
|
#pr_number ⇒ Object
91
92
93
|
# File 'lib/datadog/ci/ext/environment/providers/azure.rb', line 91
def pr_number
env["SYSTEM_PULLREQUEST_PULLREQUESTNUMBER"]
end
|
#provider_name ⇒ Object
19
20
21
|
# File 'lib/datadog/ci/ext/environment/providers/azure.rb', line 19
def provider_name
Provider::AZURE
end
|
#stage_name ⇒ Object
55
56
57
|
# File 'lib/datadog/ci/ext/environment/providers/azure.rb', line 55
def stage_name
env["SYSTEM_STAGEDISPLAYNAME"]
end
|
#workspace_path ⇒ Object
39
40
41
|
# File 'lib/datadog/ci/ext/environment/providers/azure.rb', line 39
def workspace_path
env["BUILD_SOURCESDIRECTORY"]
end
|