2017-11-05 04:45:49 +00:00
|
|
|
const { initRepo } = require('./init');
|
2017-11-03 09:01:54 +00:00
|
|
|
const { ensureOnboardingPr } = require('./onboarding/pr');
|
2017-11-05 04:45:49 +00:00
|
|
|
const { handleError } = require('./error');
|
2018-05-07 04:33:49 +00:00
|
|
|
const { processResult } = require('./result');
|
2018-05-07 10:59:32 +00:00
|
|
|
const { processRepo } = require('./process');
|
|
|
|
const { finaliseRepo } = require('./finalise');
|
2017-11-03 08:06:42 +00:00
|
|
|
|
2017-06-26 12:26:49 +00:00
|
|
|
module.exports = {
|
|
|
|
renovateRepository,
|
|
|
|
};
|
|
|
|
|
2018-05-09 06:03:59 +00:00
|
|
|
// istanbul ignore next
|
2018-04-09 04:08:39 +00:00
|
|
|
async function renovateRepository(repoConfig) {
|
2018-05-07 04:47:17 +00:00
|
|
|
let config = { ...repoConfig };
|
2017-11-08 05:44:03 +00:00
|
|
|
logger.setMeta({ repository: config.repository });
|
|
|
|
logger.info('Renovating repository');
|
2018-05-09 06:03:59 +00:00
|
|
|
logger.trace({ config });
|
2017-10-18 08:29:49 +00:00
|
|
|
try {
|
2017-11-05 04:45:49 +00:00
|
|
|
config = await initRepo(config);
|
2018-05-09 06:03:59 +00:00
|
|
|
const { res, branches, branchList, packageFiles } = await processRepo(
|
|
|
|
config
|
|
|
|
);
|
|
|
|
await ensureOnboardingPr(config, packageFiles, branches);
|
2018-05-07 10:59:32 +00:00
|
|
|
await finaliseRepo(config, branchList);
|
|
|
|
return processResult(config, res);
|
2018-04-04 17:35:01 +00:00
|
|
|
} catch (err) /* istanbul ignore next */ {
|
2018-05-07 10:59:32 +00:00
|
|
|
return processResult(config, await handleError(config, err));
|
|
|
|
} finally {
|
|
|
|
logger.info('Finished repository');
|
2018-04-10 07:19:24 +00:00
|
|
|
}
|
2017-06-26 12:26:49 +00:00
|
|
|
}
|