This repository has been archived by the owner on Jan 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 114
/
detect.js
40 lines (38 loc) · 1.22 KB
/
detect.js
1
2
3
4
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
var services = {
travis: require('./services/travis'),
circle: require('./services/circle'),
cirrus: require('./services/cirrus'),
buildkite: require('./services/buildkite'),
azurePipelines: require('./services/azurePipelines'),
codeship: require('./services/codeship'),
drone: require('./services/drone'),
appveyor: require('./services/appveyor'),
wercker: require('./services/wercker'),
jenkins: require('./services/jenkins'),
semaphore: require('./services/semaphore'),
semaphore2x: require('./services/semaphore2x'),
snap: require('./services/snap'),
gitlab: require('./services/gitlab'),
heroku: require('./services/heroku'),
teamcity: require('./services/teamcity'),
codebuild: require('./services/codebuild'),
github_actions: require('./services/github_actions'),
}
var detectProvider = function() {
var config
for (var name in services) {
if (services[name].detect()) {
config = services[name].configuration()
break
}
}
if (!config) {
var local = require('./services/localGit')
config = local.configuration()
if (!config) {
throw new Error('Unknown CI service provider. Unable to upload coverage.')
}
}
return config
}
module.exports = detectProvider