5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
# File 'lib/code_climate/test_reporter/ci.rb', line 5
def self.service_data
if ENV['TRAVIS']
{
name: "travis-ci",
branch: ENV['TRAVIS_BRANCH'],
build_identifier: ENV['TRAVIS_JOB_ID'],
pull_request: ENV['TRAVIS_PULL_REQUEST']
}
elsif ENV['CIRCLECI']
{
name: "circlci",
build_identifier: ENV['CIRCLE_BUILD_NUM'],
branch: ENV['CIRCLE_BRANCH'],
commit_sha: ENV['CIRCLE_SHA1']
}
elsif ENV['SEMAPHORE']
{
name: "semaphore",
branch: ENV['BRANCH_NAME'],
build_identifier: ENV['SEMAPHORE_BUILD_NUMBER']
}
elsif ENV['JENKINS_URL']
{
name: "jenkins",
build_identifier: ENV['BUILD_NUMBER'],
build_url: ENV['BUILD_URL'],
branch: ENV['GIT_BRANCH'],
commit_sha: ENV['GIT_COMMIT']
}
elsif ENV['TDDIUM']
{
name: "tddium",
build_identifier: ENV['TDDIUM_SESSION_ID'],
worker_id: ENV['TDDIUM_TID']
}
elsif ENV['WERCKER']
{
name: "wercker",
build_identifier: ENV['WERCKER_BUILD_ID'],
build_url: ENV['WERCKER_BUILD_URL'],
branch: ENV['WERCKER_GIT_BRANCH'],
commit_sha: ENV['WERCKER_GIT_COMMIT']
}
elsif ENV['CI_NAME'] =~ /codeship/i
{
name: "codeship",
build_identifier: ENV['CI_BUILD_NUMBER'],
build_url: ENV['CI_BUILD_URL'],
branch: ENV['CI_BRANCH'],
commit_sha: ENV['CI_COMMIT_ID'],
}
else
{}
end
end
|