renovate/lib/workers/repository/index.js

32 lines
1,013 B
JavaScript
Raw Normal View History

const { initRepo } = require('./init');
const { ensureOnboardingPr } = require('./onboarding/pr');
const { handleError } = require('./error');
2018-05-07 04:33:49 +00:00
const { processResult } = require('./result');
const { processRepo } = require('./process');
const { finaliseRepo } = require('./finalise');
module.exports = {
renovateRepository,
};
// istanbul ignore next
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');
logger.trace({ config });
try {
config = await initRepo(config);
const { res, branches, branchList, packageFiles } = await processRepo(
config
);
await ensureOnboardingPr(config, packageFiles, branches);
await finaliseRepo(config, branchList);
return processResult(config, res);
2018-04-04 17:35:01 +00:00
} catch (err) /* istanbul ignore next */ {
return processResult(config, await handleError(config, err));
} finally {
logger.info('Finished repository');
}
}