mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-13 07:26:26 +00:00
a88ba0d16a
This feature adds initial support for renovating Dockerfiles. Renovate now: - Detects all `Dockerfile`s in repo - Searches for `FROM x` in first non-comment line, breaks x into image, tag, digest - Queries public Docker registry for image:tag combination to find latest digest - Patches Dockerfile if necessary - Creates branches/PRs as like with npm Closes #795
19 lines
398 B
JavaScript
19 lines
398 B
JavaScript
module.exports = {
|
|
setNewValue,
|
|
};
|
|
|
|
function setNewValue(
|
|
currentFileContent,
|
|
depName,
|
|
currentVersion,
|
|
newVersion,
|
|
logger
|
|
) {
|
|
logger.debug(`setNewValue: ${depName} = ${newVersion}`);
|
|
const regexReplace = new RegExp(`(^|\n)FROM ${currentVersion}\n`);
|
|
const newFileContent = currentFileContent.replace(
|
|
regexReplace,
|
|
`$1FROM ${newVersion}\n`
|
|
);
|
|
return newFileContent;
|
|
}
|