mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-13 07:26:26 +00:00
4a3ed1dd6b
Add support for renovating Docker images in Kubernetes manifests
63 lines
1.3 KiB
JavaScript
63 lines
1.3 KiB
JavaScript
const managerList = [
|
|
'bazel',
|
|
'buildkite',
|
|
'circleci',
|
|
'composer',
|
|
'docker-compose',
|
|
'dockerfile',
|
|
'gitlabci',
|
|
'kubernetes',
|
|
'meteor',
|
|
'npm',
|
|
'nvm',
|
|
'pip_requirements',
|
|
'travis',
|
|
'nuget',
|
|
];
|
|
const managers = {};
|
|
for (const manager of managerList) {
|
|
// eslint-disable-next-line global-require,import/no-dynamic-require
|
|
managers[manager] = require(`./${manager}`);
|
|
}
|
|
|
|
const languageList = ['node', 'python'];
|
|
|
|
const get = (manager, name) => managers[manager][name];
|
|
const getLanguageList = () => languageList;
|
|
const getManagerList = () => managerList;
|
|
|
|
module.exports = {
|
|
get,
|
|
getLanguageList,
|
|
getManagerList,
|
|
};
|
|
|
|
const managerFunctions = [
|
|
'extractDependencies',
|
|
'postExtract',
|
|
'getPackageUpdates',
|
|
'updateDependency',
|
|
'supportsLockFileMaintenance',
|
|
];
|
|
|
|
for (const f of managerFunctions) {
|
|
module.exports[f] = (manager, ...params) => {
|
|
if (managers[manager][f]) {
|
|
return managers[manager][f](...params);
|
|
}
|
|
return null;
|
|
};
|
|
}
|
|
|
|
module.exports.getRangeStrategy = config => {
|
|
const { manager, rangeStrategy } = config;
|
|
if (managers[manager].getRangeStrategy) {
|
|
// Use manager's own function if it exists
|
|
return managers[manager].getRangeStrategy(config);
|
|
}
|
|
if (rangeStrategy === 'auto') {
|
|
// default to 'replace' for auto
|
|
return 'replace';
|
|
}
|
|
return config.rangeStrategy;
|
|
};
|