2018-04-04 11:29:38 +00:00
|
|
|
/* eslint-disable global-require */
|
|
|
|
const platforms = new Map([
|
2018-08-29 05:30:03 +00:00
|
|
|
['bitbucket', require('./bitbucket')],
|
2019-02-07 19:04:23 +00:00
|
|
|
['bitbucket-server', require('./bitbucket-server')],
|
2018-04-04 11:29:38 +00:00
|
|
|
['github', require('./github')],
|
|
|
|
['gitlab', require('./gitlab')],
|
2019-01-14 14:22:24 +00:00
|
|
|
['azure', require('./azure')],
|
2018-04-04 11:29:38 +00:00
|
|
|
]);
|
|
|
|
/* eslint-enable global-require */
|
2017-11-07 10:46:10 +00:00
|
|
|
|
2018-04-04 11:29:38 +00:00
|
|
|
function getPlatformApi(platform) {
|
|
|
|
return platforms.get(platform);
|
|
|
|
}
|
|
|
|
|
|
|
|
function initPlatform(platform) {
|
|
|
|
global.platform = getPlatformApi(platform);
|
2017-11-07 12:31:34 +00:00
|
|
|
}
|
2017-11-07 10:46:10 +00:00
|
|
|
|
2017-11-07 12:31:34 +00:00
|
|
|
module.exports = {
|
|
|
|
initPlatform,
|
2018-04-04 11:29:38 +00:00
|
|
|
getPlatformApi,
|
2017-11-07 12:31:34 +00:00
|
|
|
};
|