renovate/lib/workers/repository/index.js
Rhys Arkins ecdcd9df4f
feat: refactor dependency extraction (#1912)
Rewrite of dependency extraction, particularly for npm. Paves way for easier addition of new package managers.

Closes #1882
2018-05-09 08:03:59 +02:00

31 lines
1,013 B
JavaScript

const { initRepo } = require('./init');
const { ensureOnboardingPr } = require('./onboarding/pr');
const { handleError } = require('./error');
const { processResult } = require('./result');
const { processRepo } = require('./process');
const { finaliseRepo } = require('./finalise');
module.exports = {
renovateRepository,
};
// istanbul ignore next
async function renovateRepository(repoConfig) {
let config = { ...repoConfig };
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);
} catch (err) /* istanbul ignore next */ {
return processResult(config, await handleError(config, err));
} finally {
logger.info('Finished repository');
}
}