mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-15 00:56:26 +00:00
b724a411da
Adds support for renovating Docker Compose files (e.g. `docker-compose.yml`). Functionality is essentially the same as the existing `Dockerfile` capabilities, so config for `docker` is shared with `docker-compose` but may also be overridden. Merging as disabled by default - will wait for some opt-in testing before turning it on by default. Closes #832
42 lines
999 B
JavaScript
42 lines
999 B
JavaScript
const { splitImageParts } = require('../docker/extract');
|
|
|
|
module.exports = {
|
|
extractDependencies,
|
|
};
|
|
|
|
function extractDependencies(content) {
|
|
logger.debug('docker-compose.extractDependencies()');
|
|
const deps = [];
|
|
let lineNumber = 0;
|
|
for (const line of content.split('\n')) {
|
|
const match = line.match(/^\s*image:\s*([^\s]+)\s*$/);
|
|
if (match) {
|
|
const currentFrom = match[1];
|
|
const {
|
|
dockerRegistry,
|
|
depName,
|
|
currentTag,
|
|
currentDigest,
|
|
currentDepTagDigest,
|
|
currentDepTag,
|
|
} = splitImageParts(currentFrom);
|
|
logger.info(
|
|
{ dockerRegistry, depName, currentTag, currentDigest },
|
|
'Docker Compose image'
|
|
);
|
|
deps.push({
|
|
depType: 'Docker Compose',
|
|
lineNumber,
|
|
currentFrom,
|
|
currentDepTagDigest,
|
|
dockerRegistry,
|
|
currentDepTag,
|
|
currentDigest,
|
|
depName,
|
|
currentTag,
|
|
});
|
|
}
|
|
lineNumber += 1;
|
|
}
|
|
return deps;
|
|
}
|