mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-12 06:56:24 +00:00
feat: massage docker Node.js branches
Manually finds and massages node updates in Docker, Docker Compose and Circle CI so that they should take on the same “renovate/node-8.x” style branch naming. The goal is to unify all node updates into a single branch.
This commit is contained in:
parent
25a35b871d
commit
01ccb03b94
11 changed files with 168 additions and 13 deletions
|
@ -24,7 +24,7 @@ function extractDependencies(content) {
|
||||||
{ dockerRegistry, depName, currentTag, currentDigest },
|
{ dockerRegistry, depName, currentTag, currentDigest },
|
||||||
'CircleCI docker image'
|
'CircleCI docker image'
|
||||||
);
|
);
|
||||||
deps.push({
|
const dep = {
|
||||||
lineNumber,
|
lineNumber,
|
||||||
currentFrom,
|
currentFrom,
|
||||||
fromVersion: currentFrom,
|
fromVersion: currentFrom,
|
||||||
|
@ -35,7 +35,11 @@ function extractDependencies(content) {
|
||||||
depName,
|
depName,
|
||||||
currentTag,
|
currentTag,
|
||||||
versionScheme: 'semver',
|
versionScheme: 'semver',
|
||||||
});
|
};
|
||||||
|
if (depName === 'node' || depName.endsWith('/node')) {
|
||||||
|
dep.commitMessageTopic = 'Node.js';
|
||||||
|
}
|
||||||
|
deps.push(dep);
|
||||||
}
|
}
|
||||||
lineNumber += 1;
|
lineNumber += 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ function extractDependencies(content) {
|
||||||
{ dockerRegistry, depName, currentTag, currentDigest },
|
{ dockerRegistry, depName, currentTag, currentDigest },
|
||||||
'Docker Compose image'
|
'Docker Compose image'
|
||||||
);
|
);
|
||||||
deps.push({
|
const dep = {
|
||||||
lineNumber,
|
lineNumber,
|
||||||
currentFrom,
|
currentFrom,
|
||||||
currentDepTagDigest,
|
currentDepTagDigest,
|
||||||
|
@ -34,7 +34,11 @@ function extractDependencies(content) {
|
||||||
depName,
|
depName,
|
||||||
currentTag,
|
currentTag,
|
||||||
versionScheme: 'semver',
|
versionScheme: 'semver',
|
||||||
});
|
};
|
||||||
|
if (depName === 'node' || depName.endsWith('/node')) {
|
||||||
|
dep.commitMessageTopic = 'Node.js';
|
||||||
|
}
|
||||||
|
deps.push(dep);
|
||||||
}
|
}
|
||||||
lineNumber += 1;
|
lineNumber += 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,7 +70,8 @@ function extractDependencies(content) {
|
||||||
} else if (stageNames.includes(currentFrom)) {
|
} else if (stageNames.includes(currentFrom)) {
|
||||||
logger.debug({ currentFrom }, 'Skipping alias FROM');
|
logger.debug({ currentFrom }, 'Skipping alias FROM');
|
||||||
} else {
|
} else {
|
||||||
deps.push({
|
const dep = {
|
||||||
|
language: 'docker',
|
||||||
fromLine,
|
fromLine,
|
||||||
fromPrefix,
|
fromPrefix,
|
||||||
currentFrom,
|
currentFrom,
|
||||||
|
@ -82,7 +83,11 @@ function extractDependencies(content) {
|
||||||
depName,
|
depName,
|
||||||
currentTag,
|
currentTag,
|
||||||
versionScheme: 'semver',
|
versionScheme: 'semver',
|
||||||
});
|
};
|
||||||
|
if (depName === 'node' || depName.endsWith('/node')) {
|
||||||
|
dep.commitMessageTopic = 'Node.js';
|
||||||
|
}
|
||||||
|
deps.push(dep);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (!deps.length) {
|
if (!deps.length) {
|
||||||
|
|
|
@ -38,7 +38,13 @@ function flattenUpdates(config, packageFiles) {
|
||||||
.replace(/\s+/g, '-')
|
.replace(/\s+/g, '-')
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
: undefined;
|
: undefined;
|
||||||
update.versionScheme = update.versionScheme || 'semver';
|
if (
|
||||||
|
updateConfig.language === 'docker' &&
|
||||||
|
updateConfig.depName.match(/(^|\/)node$/)
|
||||||
|
) {
|
||||||
|
updateConfig.managerBranchPrefix = '';
|
||||||
|
updateConfig.depNameSanitized = 'node';
|
||||||
|
}
|
||||||
delete updateConfig.repoIsOnboarded;
|
delete updateConfig.repoIsOnboarded;
|
||||||
delete updateConfig.renovateJsonPresent;
|
delete updateConfig.renovateJsonPresent;
|
||||||
updates.push(updateConfig);
|
updates.push(updateConfig);
|
||||||
|
|
|
@ -15,6 +15,9 @@ services:
|
||||||
restart_policy:
|
restart_policy:
|
||||||
condition: on-failure
|
condition: on-failure
|
||||||
|
|
||||||
|
worker:
|
||||||
|
image: "node:10.0.0"
|
||||||
|
|
||||||
db:
|
db:
|
||||||
image: "postgres:9.4.0"
|
image: "postgres:9.4.0"
|
||||||
volumes:
|
volumes:
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
exports[`lib/manager/circleci/extract extractDependencies() extracts multiple image lines 1`] = `
|
exports[`lib/manager/circleci/extract extractDependencies() extracts multiple image lines 1`] = `
|
||||||
Array [
|
Array [
|
||||||
Object {
|
Object {
|
||||||
|
"commitMessageTopic": "Node.js",
|
||||||
"currentDepTag": "node",
|
"currentDepTag": "node",
|
||||||
"currentDepTagDigest": "node",
|
"currentDepTagDigest": "node",
|
||||||
"currentDigest": undefined,
|
"currentDigest": undefined,
|
||||||
|
@ -15,6 +16,7 @@ Array [
|
||||||
"versionScheme": "semver",
|
"versionScheme": "semver",
|
||||||
},
|
},
|
||||||
Object {
|
Object {
|
||||||
|
"commitMessageTopic": "Node.js",
|
||||||
"currentDepTag": "node:4",
|
"currentDepTag": "node:4",
|
||||||
"currentDepTagDigest": "node:4",
|
"currentDepTagDigest": "node:4",
|
||||||
"currentDigest": undefined,
|
"currentDigest": undefined,
|
||||||
|
@ -27,6 +29,7 @@ Array [
|
||||||
"versionScheme": "semver",
|
"versionScheme": "semver",
|
||||||
},
|
},
|
||||||
Object {
|
Object {
|
||||||
|
"commitMessageTopic": "Node.js",
|
||||||
"currentDepTag": "node:6",
|
"currentDepTag": "node:6",
|
||||||
"currentDepTagDigest": "node:6",
|
"currentDepTagDigest": "node:6",
|
||||||
"currentDigest": undefined,
|
"currentDigest": undefined,
|
||||||
|
@ -39,6 +42,7 @@ Array [
|
||||||
"versionScheme": "semver",
|
"versionScheme": "semver",
|
||||||
},
|
},
|
||||||
Object {
|
Object {
|
||||||
|
"commitMessageTopic": "Node.js",
|
||||||
"currentDepTag": "node:8.9.0",
|
"currentDepTag": "node:8.9.0",
|
||||||
"currentDepTagDigest": "node:8.9.0",
|
"currentDepTagDigest": "node:8.9.0",
|
||||||
"currentDigest": undefined,
|
"currentDigest": undefined,
|
||||||
|
|
|
@ -13,6 +13,18 @@ Array [
|
||||||
"lineNumber": 4,
|
"lineNumber": 4,
|
||||||
"versionScheme": "semver",
|
"versionScheme": "semver",
|
||||||
},
|
},
|
||||||
|
Object {
|
||||||
|
"commitMessageTopic": "Node.js",
|
||||||
|
"currentDepTag": "node:10.0.0",
|
||||||
|
"currentDepTagDigest": "node:10.0.0",
|
||||||
|
"currentDigest": undefined,
|
||||||
|
"currentFrom": "node:10.0.0",
|
||||||
|
"currentTag": "10.0.0",
|
||||||
|
"depName": "node",
|
||||||
|
"dockerRegistry": undefined,
|
||||||
|
"lineNumber": 18,
|
||||||
|
"versionScheme": "semver",
|
||||||
|
},
|
||||||
Object {
|
Object {
|
||||||
"currentDepTag": "postgres:9.4.0",
|
"currentDepTag": "postgres:9.4.0",
|
||||||
"currentDepTagDigest": "postgres:9.4.0",
|
"currentDepTagDigest": "postgres:9.4.0",
|
||||||
|
@ -21,7 +33,7 @@ Array [
|
||||||
"currentTag": "9.4.0",
|
"currentTag": "9.4.0",
|
||||||
"depName": "postgres",
|
"depName": "postgres",
|
||||||
"dockerRegistry": undefined,
|
"dockerRegistry": undefined,
|
||||||
"lineNumber": 18,
|
"lineNumber": 21,
|
||||||
"versionScheme": "semver",
|
"versionScheme": "semver",
|
||||||
},
|
},
|
||||||
Object {
|
Object {
|
||||||
|
@ -32,7 +44,7 @@ Array [
|
||||||
"currentTag": "before",
|
"currentTag": "before",
|
||||||
"depName": "dockersamples/examplevotingapp_vote",
|
"depName": "dockersamples/examplevotingapp_vote",
|
||||||
"dockerRegistry": undefined,
|
"dockerRegistry": undefined,
|
||||||
"lineNumber": 28,
|
"lineNumber": 31,
|
||||||
"versionScheme": "semver",
|
"versionScheme": "semver",
|
||||||
},
|
},
|
||||||
Object {
|
Object {
|
||||||
|
@ -43,7 +55,7 @@ Array [
|
||||||
"currentTag": "before",
|
"currentTag": "before",
|
||||||
"depName": "dockersamples/examplevotingapp_result",
|
"depName": "dockersamples/examplevotingapp_result",
|
||||||
"dockerRegistry": undefined,
|
"dockerRegistry": undefined,
|
||||||
"lineNumber": 43,
|
"lineNumber": 46,
|
||||||
"versionScheme": "semver",
|
"versionScheme": "semver",
|
||||||
},
|
},
|
||||||
Object {
|
Object {
|
||||||
|
@ -54,7 +66,7 @@ Array [
|
||||||
"currentTag": undefined,
|
"currentTag": undefined,
|
||||||
"depName": "dockersamples/examplevotingapp_worker",
|
"depName": "dockersamples/examplevotingapp_worker",
|
||||||
"dockerRegistry": undefined,
|
"dockerRegistry": undefined,
|
||||||
"lineNumber": 59,
|
"lineNumber": 62,
|
||||||
"versionScheme": "semver",
|
"versionScheme": "semver",
|
||||||
},
|
},
|
||||||
Object {
|
Object {
|
||||||
|
@ -65,7 +77,7 @@ Array [
|
||||||
"currentTag": "stable",
|
"currentTag": "stable",
|
||||||
"depName": "dockersamples/visualizer",
|
"depName": "dockersamples/visualizer",
|
||||||
"dockerRegistry": undefined,
|
"dockerRegistry": undefined,
|
||||||
"lineNumber": 76,
|
"lineNumber": 79,
|
||||||
"versionScheme": "semver",
|
"versionScheme": "semver",
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
|
@ -20,7 +20,7 @@ describe('lib/manager/docker-compose/extract', () => {
|
||||||
it('extracts multiple image lines', () => {
|
it('extracts multiple image lines', () => {
|
||||||
const res = extractDependencies(yamlFile, config);
|
const res = extractDependencies(yamlFile, config);
|
||||||
expect(res.deps).toMatchSnapshot();
|
expect(res.deps).toMatchSnapshot();
|
||||||
expect(res.deps).toHaveLength(6);
|
expect(res.deps).toHaveLength(7);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
exports[`lib/manager/docker/extract extractDependencies() extracts images on adjacent lines 1`] = `
|
exports[`lib/manager/docker/extract extractDependencies() extracts images on adjacent lines 1`] = `
|
||||||
Array [
|
Array [
|
||||||
Object {
|
Object {
|
||||||
|
"commitMessageTopic": "Node.js",
|
||||||
"currentDepTag": "node:8.11.3-alpine",
|
"currentDepTag": "node:8.11.3-alpine",
|
||||||
"currentDepTagDigest": "node:8.11.3-alpine@sha256:d743b4141b02fcfb8beb68f92b4cd164f60ee457bf2d053f36785bf86de16b0d",
|
"currentDepTagDigest": "node:8.11.3-alpine@sha256:d743b4141b02fcfb8beb68f92b4cd164f60ee457bf2d053f36785bf86de16b0d",
|
||||||
"currentDigest": "sha256:d743b4141b02fcfb8beb68f92b4cd164f60ee457bf2d053f36785bf86de16b0d",
|
"currentDigest": "sha256:d743b4141b02fcfb8beb68f92b4cd164f60ee457bf2d053f36785bf86de16b0d",
|
||||||
|
@ -13,6 +14,7 @@ Array [
|
||||||
"fromLine": "FROM node:8.11.3-alpine@sha256:d743b4141b02fcfb8beb68f92b4cd164f60ee457bf2d053f36785bf86de16b0d AS node",
|
"fromLine": "FROM node:8.11.3-alpine@sha256:d743b4141b02fcfb8beb68f92b4cd164f60ee457bf2d053f36785bf86de16b0d AS node",
|
||||||
"fromPrefix": "FROM",
|
"fromPrefix": "FROM",
|
||||||
"fromSuffix": "AS node",
|
"fromSuffix": "AS node",
|
||||||
|
"language": "docker",
|
||||||
"versionScheme": "semver",
|
"versionScheme": "semver",
|
||||||
},
|
},
|
||||||
Object {
|
Object {
|
||||||
|
@ -26,6 +28,7 @@ Array [
|
||||||
"fromLine": "FROM buildkite/puppeteer:1.1.1 AS puppeteer",
|
"fromLine": "FROM buildkite/puppeteer:1.1.1 AS puppeteer",
|
||||||
"fromPrefix": "FROM",
|
"fromPrefix": "FROM",
|
||||||
"fromSuffix": "AS puppeteer",
|
"fromSuffix": "AS puppeteer",
|
||||||
|
"language": "docker",
|
||||||
"versionScheme": "semver",
|
"versionScheme": "semver",
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
@ -34,6 +37,7 @@ Array [
|
||||||
exports[`lib/manager/docker/extract extractDependencies() extracts multiple FROM tags 1`] = `
|
exports[`lib/manager/docker/extract extractDependencies() extracts multiple FROM tags 1`] = `
|
||||||
Array [
|
Array [
|
||||||
Object {
|
Object {
|
||||||
|
"commitMessageTopic": "Node.js",
|
||||||
"currentDepTag": "node:6.12.3",
|
"currentDepTag": "node:6.12.3",
|
||||||
"currentDepTagDigest": "node:6.12.3",
|
"currentDepTagDigest": "node:6.12.3",
|
||||||
"currentDigest": undefined,
|
"currentDigest": undefined,
|
||||||
|
@ -44,6 +48,7 @@ Array [
|
||||||
"fromLine": "FROM node:6.12.3 as frontend",
|
"fromLine": "FROM node:6.12.3 as frontend",
|
||||||
"fromPrefix": "FROM",
|
"fromPrefix": "FROM",
|
||||||
"fromSuffix": "as frontend",
|
"fromSuffix": "as frontend",
|
||||||
|
"language": "docker",
|
||||||
"versionScheme": "semver",
|
"versionScheme": "semver",
|
||||||
},
|
},
|
||||||
Object {
|
Object {
|
||||||
|
@ -57,6 +62,7 @@ Array [
|
||||||
"fromLine": "FROM python:3.6-slim",
|
"fromLine": "FROM python:3.6-slim",
|
||||||
"fromPrefix": "FROM",
|
"fromPrefix": "FROM",
|
||||||
"fromSuffix": "",
|
"fromSuffix": "",
|
||||||
|
"language": "docker",
|
||||||
"versionScheme": "semver",
|
"versionScheme": "semver",
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
@ -65,6 +71,7 @@ Array [
|
||||||
exports[`lib/manager/docker/extract extractDependencies() handles abnoral spacing 1`] = `
|
exports[`lib/manager/docker/extract extractDependencies() handles abnoral spacing 1`] = `
|
||||||
Array [
|
Array [
|
||||||
Object {
|
Object {
|
||||||
|
"commitMessageTopic": "Node.js",
|
||||||
"currentDepTag": "node:8.7.0",
|
"currentDepTag": "node:8.7.0",
|
||||||
"currentDepTagDigest": "node:8.7.0",
|
"currentDepTagDigest": "node:8.7.0",
|
||||||
"currentDigest": undefined,
|
"currentDigest": undefined,
|
||||||
|
@ -75,6 +82,7 @@ Array [
|
||||||
"fromLine": "FROM registry.allmine.info:5005/node:8.7.0",
|
"fromLine": "FROM registry.allmine.info:5005/node:8.7.0",
|
||||||
"fromPrefix": "FROM",
|
"fromPrefix": "FROM",
|
||||||
"fromSuffix": "",
|
"fromSuffix": "",
|
||||||
|
"language": "docker",
|
||||||
"versionScheme": "semver",
|
"versionScheme": "semver",
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
@ -83,6 +91,7 @@ Array [
|
||||||
exports[`lib/manager/docker/extract extractDependencies() handles comments 1`] = `
|
exports[`lib/manager/docker/extract extractDependencies() handles comments 1`] = `
|
||||||
Array [
|
Array [
|
||||||
Object {
|
Object {
|
||||||
|
"commitMessageTopic": "Node.js",
|
||||||
"currentDepTag": "node",
|
"currentDepTag": "node",
|
||||||
"currentDepTagDigest": "node",
|
"currentDepTagDigest": "node",
|
||||||
"currentDigest": undefined,
|
"currentDigest": undefined,
|
||||||
|
@ -93,6 +102,7 @@ Array [
|
||||||
"fromLine": "FROM node",
|
"fromLine": "FROM node",
|
||||||
"fromPrefix": "FROM",
|
"fromPrefix": "FROM",
|
||||||
"fromSuffix": "",
|
"fromSuffix": "",
|
||||||
|
"language": "docker",
|
||||||
"versionScheme": "semver",
|
"versionScheme": "semver",
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
@ -101,6 +111,7 @@ Array [
|
||||||
exports[`lib/manager/docker/extract extractDependencies() handles custom hosts 1`] = `
|
exports[`lib/manager/docker/extract extractDependencies() handles custom hosts 1`] = `
|
||||||
Array [
|
Array [
|
||||||
Object {
|
Object {
|
||||||
|
"commitMessageTopic": "Node.js",
|
||||||
"currentDepTag": "node:8",
|
"currentDepTag": "node:8",
|
||||||
"currentDepTagDigest": "node:8",
|
"currentDepTagDigest": "node:8",
|
||||||
"currentDigest": undefined,
|
"currentDigest": undefined,
|
||||||
|
@ -111,6 +122,7 @@ Array [
|
||||||
"fromLine": "FROM registry2.something.info/node:8",
|
"fromLine": "FROM registry2.something.info/node:8",
|
||||||
"fromPrefix": "FROM",
|
"fromPrefix": "FROM",
|
||||||
"fromSuffix": "",
|
"fromSuffix": "",
|
||||||
|
"language": "docker",
|
||||||
"versionScheme": "semver",
|
"versionScheme": "semver",
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
@ -119,6 +131,7 @@ Array [
|
||||||
exports[`lib/manager/docker/extract extractDependencies() handles custom hosts with namespace 1`] = `
|
exports[`lib/manager/docker/extract extractDependencies() handles custom hosts with namespace 1`] = `
|
||||||
Array [
|
Array [
|
||||||
Object {
|
Object {
|
||||||
|
"commitMessageTopic": "Node.js",
|
||||||
"currentDepTag": "someaccount/node:8",
|
"currentDepTag": "someaccount/node:8",
|
||||||
"currentDepTagDigest": "someaccount/node:8",
|
"currentDepTagDigest": "someaccount/node:8",
|
||||||
"currentDigest": undefined,
|
"currentDigest": undefined,
|
||||||
|
@ -129,6 +142,7 @@ Array [
|
||||||
"fromLine": "FROM registry2.something.info/someaccount/node:8",
|
"fromLine": "FROM registry2.something.info/someaccount/node:8",
|
||||||
"fromPrefix": "FROM",
|
"fromPrefix": "FROM",
|
||||||
"fromSuffix": "",
|
"fromSuffix": "",
|
||||||
|
"language": "docker",
|
||||||
"versionScheme": "semver",
|
"versionScheme": "semver",
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
@ -137,6 +151,7 @@ Array [
|
||||||
exports[`lib/manager/docker/extract extractDependencies() handles custom hosts with port 1`] = `
|
exports[`lib/manager/docker/extract extractDependencies() handles custom hosts with port 1`] = `
|
||||||
Array [
|
Array [
|
||||||
Object {
|
Object {
|
||||||
|
"commitMessageTopic": "Node.js",
|
||||||
"currentDepTag": "node:8",
|
"currentDepTag": "node:8",
|
||||||
"currentDepTagDigest": "node:8",
|
"currentDepTagDigest": "node:8",
|
||||||
"currentDigest": undefined,
|
"currentDigest": undefined,
|
||||||
|
@ -147,6 +162,7 @@ Array [
|
||||||
"fromLine": "FROM registry2.something.info:5005/node:8",
|
"fromLine": "FROM registry2.something.info:5005/node:8",
|
||||||
"fromPrefix": "FROM",
|
"fromPrefix": "FROM",
|
||||||
"fromSuffix": "",
|
"fromSuffix": "",
|
||||||
|
"language": "docker",
|
||||||
"versionScheme": "semver",
|
"versionScheme": "semver",
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
@ -155,6 +171,7 @@ Array [
|
||||||
exports[`lib/manager/docker/extract extractDependencies() handles digest 1`] = `
|
exports[`lib/manager/docker/extract extractDependencies() handles digest 1`] = `
|
||||||
Array [
|
Array [
|
||||||
Object {
|
Object {
|
||||||
|
"commitMessageTopic": "Node.js",
|
||||||
"currentDepTag": "node",
|
"currentDepTag": "node",
|
||||||
"currentDepTagDigest": "node@sha256:eb85fc5b1198f5e1ec025ea07586bdbbf397e7d82df66c90d7511f533517e063",
|
"currentDepTagDigest": "node@sha256:eb85fc5b1198f5e1ec025ea07586bdbbf397e7d82df66c90d7511f533517e063",
|
||||||
"currentDigest": "sha256:eb85fc5b1198f5e1ec025ea07586bdbbf397e7d82df66c90d7511f533517e063",
|
"currentDigest": "sha256:eb85fc5b1198f5e1ec025ea07586bdbbf397e7d82df66c90d7511f533517e063",
|
||||||
|
@ -165,6 +182,7 @@ Array [
|
||||||
"fromLine": "FROM node@sha256:eb85fc5b1198f5e1ec025ea07586bdbbf397e7d82df66c90d7511f533517e063",
|
"fromLine": "FROM node@sha256:eb85fc5b1198f5e1ec025ea07586bdbbf397e7d82df66c90d7511f533517e063",
|
||||||
"fromPrefix": "FROM",
|
"fromPrefix": "FROM",
|
||||||
"fromSuffix": "",
|
"fromSuffix": "",
|
||||||
|
"language": "docker",
|
||||||
"versionScheme": "semver",
|
"versionScheme": "semver",
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
@ -173,6 +191,7 @@ Array [
|
||||||
exports[`lib/manager/docker/extract extractDependencies() handles from as 1`] = `
|
exports[`lib/manager/docker/extract extractDependencies() handles from as 1`] = `
|
||||||
Array [
|
Array [
|
||||||
Object {
|
Object {
|
||||||
|
"commitMessageTopic": "Node.js",
|
||||||
"currentDepTag": "node:8.9.0-alpine",
|
"currentDepTag": "node:8.9.0-alpine",
|
||||||
"currentDepTagDigest": "node:8.9.0-alpine",
|
"currentDepTagDigest": "node:8.9.0-alpine",
|
||||||
"currentDigest": undefined,
|
"currentDigest": undefined,
|
||||||
|
@ -183,6 +202,7 @@ Array [
|
||||||
"fromLine": "FROM node:8.9.0-alpine as base",
|
"fromLine": "FROM node:8.9.0-alpine as base",
|
||||||
"fromPrefix": "FROM",
|
"fromPrefix": "FROM",
|
||||||
"fromSuffix": "as base",
|
"fromSuffix": "as base",
|
||||||
|
"language": "docker",
|
||||||
"versionScheme": "semver",
|
"versionScheme": "semver",
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
@ -191,6 +211,7 @@ Array [
|
||||||
exports[`lib/manager/docker/extract extractDependencies() handles naked dep 1`] = `
|
exports[`lib/manager/docker/extract extractDependencies() handles naked dep 1`] = `
|
||||||
Array [
|
Array [
|
||||||
Object {
|
Object {
|
||||||
|
"commitMessageTopic": "Node.js",
|
||||||
"currentDepTag": "node",
|
"currentDepTag": "node",
|
||||||
"currentDepTagDigest": "node",
|
"currentDepTagDigest": "node",
|
||||||
"currentDigest": undefined,
|
"currentDigest": undefined,
|
||||||
|
@ -201,6 +222,7 @@ Array [
|
||||||
"fromLine": "FROM node",
|
"fromLine": "FROM node",
|
||||||
"fromPrefix": "FROM",
|
"fromPrefix": "FROM",
|
||||||
"fromSuffix": "",
|
"fromSuffix": "",
|
||||||
|
"language": "docker",
|
||||||
"versionScheme": "semver",
|
"versionScheme": "semver",
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
@ -209,6 +231,7 @@ Array [
|
||||||
exports[`lib/manager/docker/extract extractDependencies() handles namespaced images 1`] = `
|
exports[`lib/manager/docker/extract extractDependencies() handles namespaced images 1`] = `
|
||||||
Array [
|
Array [
|
||||||
Object {
|
Object {
|
||||||
|
"commitMessageTopic": "Node.js",
|
||||||
"currentDepTag": "mynamespace/node:8",
|
"currentDepTag": "mynamespace/node:8",
|
||||||
"currentDepTagDigest": "mynamespace/node:8",
|
"currentDepTagDigest": "mynamespace/node:8",
|
||||||
"currentDigest": undefined,
|
"currentDigest": undefined,
|
||||||
|
@ -219,6 +242,7 @@ Array [
|
||||||
"fromLine": "FROM mynamespace/node:8",
|
"fromLine": "FROM mynamespace/node:8",
|
||||||
"fromPrefix": "FROM",
|
"fromPrefix": "FROM",
|
||||||
"fromSuffix": "",
|
"fromSuffix": "",
|
||||||
|
"language": "docker",
|
||||||
"versionScheme": "semver",
|
"versionScheme": "semver",
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
@ -227,6 +251,7 @@ Array [
|
||||||
exports[`lib/manager/docker/extract extractDependencies() handles tag 1`] = `
|
exports[`lib/manager/docker/extract extractDependencies() handles tag 1`] = `
|
||||||
Array [
|
Array [
|
||||||
Object {
|
Object {
|
||||||
|
"commitMessageTopic": "Node.js",
|
||||||
"currentDepTag": "node:8.9.0-alpine",
|
"currentDepTag": "node:8.9.0-alpine",
|
||||||
"currentDepTagDigest": "node:8.9.0-alpine",
|
"currentDepTagDigest": "node:8.9.0-alpine",
|
||||||
"currentDigest": undefined,
|
"currentDigest": undefined,
|
||||||
|
@ -237,6 +262,7 @@ Array [
|
||||||
"fromLine": "FROM node:8.9.0-alpine",
|
"fromLine": "FROM node:8.9.0-alpine",
|
||||||
"fromPrefix": "FROM",
|
"fromPrefix": "FROM",
|
||||||
"fromSuffix": "",
|
"fromSuffix": "",
|
||||||
|
"language": "docker",
|
||||||
"versionScheme": "semver",
|
"versionScheme": "semver",
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
@ -245,6 +271,7 @@ Array [
|
||||||
exports[`lib/manager/docker/extract extractDependencies() handles tag and digest 1`] = `
|
exports[`lib/manager/docker/extract extractDependencies() handles tag and digest 1`] = `
|
||||||
Array [
|
Array [
|
||||||
Object {
|
Object {
|
||||||
|
"commitMessageTopic": "Node.js",
|
||||||
"currentDepTag": "node:8.9.0",
|
"currentDepTag": "node:8.9.0",
|
||||||
"currentDepTagDigest": "node:8.9.0@sha256:eb85fc5b1198f5e1ec025ea07586bdbbf397e7d82df66c90d7511f533517e063",
|
"currentDepTagDigest": "node:8.9.0@sha256:eb85fc5b1198f5e1ec025ea07586bdbbf397e7d82df66c90d7511f533517e063",
|
||||||
"currentDigest": "sha256:eb85fc5b1198f5e1ec025ea07586bdbbf397e7d82df66c90d7511f533517e063",
|
"currentDigest": "sha256:eb85fc5b1198f5e1ec025ea07586bdbbf397e7d82df66c90d7511f533517e063",
|
||||||
|
@ -255,6 +282,7 @@ Array [
|
||||||
"fromLine": "FROM node:8.9.0@sha256:eb85fc5b1198f5e1ec025ea07586bdbbf397e7d82df66c90d7511f533517e063",
|
"fromLine": "FROM node:8.9.0@sha256:eb85fc5b1198f5e1ec025ea07586bdbbf397e7d82df66c90d7511f533517e063",
|
||||||
"fromPrefix": "FROM",
|
"fromPrefix": "FROM",
|
||||||
"fromSuffix": "",
|
"fromSuffix": "",
|
||||||
|
"language": "docker",
|
||||||
"versionScheme": "semver",
|
"versionScheme": "semver",
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
@ -263,6 +291,7 @@ Array [
|
||||||
exports[`lib/manager/docker/extract extractDependencies() is case insensitive 1`] = `
|
exports[`lib/manager/docker/extract extractDependencies() is case insensitive 1`] = `
|
||||||
Array [
|
Array [
|
||||||
Object {
|
Object {
|
||||||
|
"commitMessageTopic": "Node.js",
|
||||||
"currentDepTag": "node",
|
"currentDepTag": "node",
|
||||||
"currentDepTagDigest": "node",
|
"currentDepTagDigest": "node",
|
||||||
"currentDigest": undefined,
|
"currentDigest": undefined,
|
||||||
|
@ -273,6 +302,7 @@ Array [
|
||||||
"fromLine": "From node",
|
"fromLine": "From node",
|
||||||
"fromPrefix": "From",
|
"fromPrefix": "From",
|
||||||
"fromSuffix": "",
|
"fromSuffix": "",
|
||||||
|
"language": "docker",
|
||||||
"versionScheme": "semver",
|
"versionScheme": "semver",
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
@ -281,6 +311,7 @@ Array [
|
||||||
exports[`lib/manager/docker/extract extractDependencies() skips named multistage FROM tags 1`] = `
|
exports[`lib/manager/docker/extract extractDependencies() skips named multistage FROM tags 1`] = `
|
||||||
Array [
|
Array [
|
||||||
Object {
|
Object {
|
||||||
|
"commitMessageTopic": "Node.js",
|
||||||
"currentDepTag": "node:6.12.3",
|
"currentDepTag": "node:6.12.3",
|
||||||
"currentDepTagDigest": "node:6.12.3",
|
"currentDepTagDigest": "node:6.12.3",
|
||||||
"currentDigest": undefined,
|
"currentDigest": undefined,
|
||||||
|
@ -291,6 +322,7 @@ Array [
|
||||||
"fromLine": "FROM node:6.12.3 as frontend",
|
"fromLine": "FROM node:6.12.3 as frontend",
|
||||||
"fromPrefix": "FROM",
|
"fromPrefix": "FROM",
|
||||||
"fromSuffix": "as frontend",
|
"fromSuffix": "as frontend",
|
||||||
|
"language": "docker",
|
||||||
"versionScheme": "semver",
|
"versionScheme": "semver",
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
|
@ -216,5 +216,78 @@ Array [
|
||||||
"warnings": Array [],
|
"warnings": Array [],
|
||||||
"yarnrc": null,
|
"yarnrc": null,
|
||||||
},
|
},
|
||||||
|
Object {
|
||||||
|
"assignees": Array [],
|
||||||
|
"automerge": false,
|
||||||
|
"automergeComment": "automergeComment",
|
||||||
|
"automergeType": "pr",
|
||||||
|
"branchName": "{{{branchPrefix}}}{{{managerBranchPrefix}}}{{{branchTopic}}}",
|
||||||
|
"branchPrefix": "renovate/",
|
||||||
|
"branchTopic": "{{{depNameSanitized}}}-{{{newMajor}}}.x",
|
||||||
|
"bumpVersion": null,
|
||||||
|
"commitBody": null,
|
||||||
|
"commitMessage": "{{{commitMessagePrefix}}} {{{commitMessageAction}}} {{{commitMessageTopic}}} {{{commitMessageExtra}}} {{{commitMessageSuffix}}}",
|
||||||
|
"commitMessageAction": "Update",
|
||||||
|
"commitMessageExtra": "to {{#if isMajor}}v{{{newMajor}}}{{else}}{{#unless isRange}}v{{/unless}}{{{newValue}}}{{/if}}",
|
||||||
|
"commitMessagePrefix": null,
|
||||||
|
"commitMessageTopic": "{{{depName}}} Docker tag",
|
||||||
|
"copyLocalLibs": false,
|
||||||
|
"depName": "amd64/node",
|
||||||
|
"depNameSanitized": "node",
|
||||||
|
"errors": Array [],
|
||||||
|
"gitAuthor": null,
|
||||||
|
"gitPrivateKey": null,
|
||||||
|
"group": Object {
|
||||||
|
"branchTopic": "{{{groupSlug}}}",
|
||||||
|
"commitMessageTopic": "{{{groupName}}} Docker tags",
|
||||||
|
"prBody": "This Pull Request updates Dockerfiles to use image digests.\\n\\n{{#if schedule}}\\n**Note**: This PR was created on a configured schedule (\\"{{{schedule}}}\\"{{#if timezone}} in timezone \`{{{timezone}}}\`{{/if}}) and will not receive updates outside those times.\\n{{/if}}\\n\\n{{#each upgrades as |upgrade|}}\\n- {{#if repositoryUrl}}[{{upgrade.depName}}]({{upgrade.repositoryUrl}}){{else}}\`{{{depName}}}\`{{/if}}: \`{{upgrade.newDigest}}\`\\n{{/each}}\\n\\n{{#if hasErrors}}\\n\\n---\\n\\n# Errors\\n\\nRenovate encountered some errors when processing your repository, so you are being notified here even if they do not directly apply to this PR.\\n\\n{{#each errors as |error|}}\\n- \`{{error.depName}}\`: {{error.message}}\\n{{/each}}\\n{{/if}}\\n\\n{{#if hasWarnings}}\\n\\n---\\n\\n# Warnings\\n\\nPlease make sure the following warnings are safe to ignore:\\n\\n{{#each warnings as |warning|}}\\n- \`{{warning.depName}}\`: {{warning.message}}\\n{{/each}}\\n{{/if}}",
|
||||||
|
},
|
||||||
|
"groupName": null,
|
||||||
|
"groupSlug": null,
|
||||||
|
"labels": Array [],
|
||||||
|
"language": "docker",
|
||||||
|
"lazyGrouping": true,
|
||||||
|
"lockFileMaintenance": Object {
|
||||||
|
"branchTopic": "lock-file-maintenance",
|
||||||
|
"commitMessageAction": "Lock file maintenance",
|
||||||
|
"commitMessageExtra": null,
|
||||||
|
"commitMessageTopic": null,
|
||||||
|
"enabled": true,
|
||||||
|
"groupName": null,
|
||||||
|
"prBody": "This Pull Request updates \`package.json\` lock files to use the latest dependency versions.\\n\\n{{#if schedule}}\\n**Note**: This PR was created on a configured schedule (\\"{{{schedule}}}\\"{{#if timezone}} in timezone \`{{{timezone}}}\`{{/if}}) and will not receive updates outside those times.\\n{{/if}}\\n\\n{{#if hasErrors}}\\n\\n---\\n\\n# Errors\\n\\nRenovate encountered some errors when processing your repository, so you are being notified here even if they do not directly apply to this PR.\\n\\n{{#each errors as |error|}}\\n- \`{{error.depName}}\`: {{error.message}}\\n{{/each}}\\n{{/if}}\\n\\n{{#if hasWarnings}}\\n\\n---\\n\\n# Warnings\\n\\nPlease make sure the following warnings are safe to ignore:\\n\\n{{#each warnings as |warning|}}\\n- \`{{warning.depName}}\`: {{warning.message}}\\n{{/each}}\\n{{/if}}",
|
||||||
|
"rebaseStalePrs": true,
|
||||||
|
"recreateClosed": true,
|
||||||
|
"schedule": Array [
|
||||||
|
"before 5am on monday",
|
||||||
|
],
|
||||||
|
},
|
||||||
|
"manager": "docker",
|
||||||
|
"managerBranchPrefix": "",
|
||||||
|
"newValue": "10.0.1",
|
||||||
|
"npmToken": null,
|
||||||
|
"npmrc": null,
|
||||||
|
"packageFile": "Dockerfile",
|
||||||
|
"prBody": "This Pull Request updates Docker base image \`{{{depName}}}\` from tag \`{{{currentTag}}}\` to new tag \`{{{newTag}}}\`. For details on Renovate's Docker support, please visit https://renovatebot.com/docs/docker\\n\\n{{#if schedule}}\\n**Note**: This PR was created on a configured schedule (\\"{{{schedule}}}\\"{{#if timezone}} in timezone \`{{{timezone}}}\`{{/if}}) and will not receive updates outside those times.\\n{{/if}}\\n\\n{{#if hasErrors}}\\n\\n---\\n\\n# Errors\\n\\nRenovate encountered some errors when processing your repository, so you are being notified here even if they do not directly apply to this PR.\\n\\n{{#each errors as |error|}}\\n- \`{{error.depName}}\`: {{error.message}}\\n{{/each}}\\n{{/if}}\\n\\n{{#if hasWarnings}}\\n\\n---\\n\\n# Warnings\\n\\nPlease make sure the following warnings are safe to ignore:\\n\\n{{#each warnings as |warning|}}\\n- \`{{warning.depName}}\`: {{warning.message}}\\n{{/each}}\\n{{/if}}",
|
||||||
|
"prConcurrentLimit": 0,
|
||||||
|
"prCreation": "immediate",
|
||||||
|
"prHourlyLimit": 0,
|
||||||
|
"prNotPendingHours": 25,
|
||||||
|
"prTitle": null,
|
||||||
|
"rebaseStalePrs": null,
|
||||||
|
"recreateClosed": false,
|
||||||
|
"requiredStatusChecks": Array [],
|
||||||
|
"reviewers": Array [],
|
||||||
|
"schedule": Array [],
|
||||||
|
"semanticCommitScope": "deps",
|
||||||
|
"semanticCommitType": "chore",
|
||||||
|
"semanticCommits": null,
|
||||||
|
"statusCheckVerify": false,
|
||||||
|
"timezone": null,
|
||||||
|
"unpublishSafe": false,
|
||||||
|
"updateLockFiles": true,
|
||||||
|
"updateNotScheduled": true,
|
||||||
|
"warnings": Array [],
|
||||||
|
"yarnrc": null,
|
||||||
|
},
|
||||||
]
|
]
|
||||||
`;
|
`;
|
||||||
|
|
|
@ -24,6 +24,18 @@ describe('workers/repository/updates/flatten', () => {
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
docker: [
|
||||||
|
{
|
||||||
|
packageFile: 'Dockerfile',
|
||||||
|
deps: [
|
||||||
|
{
|
||||||
|
depName: 'amd64/node',
|
||||||
|
language: 'docker',
|
||||||
|
updates: [{ newValue: '10.0.1' }],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
};
|
};
|
||||||
const res = await flattenUpdates(config, packageFiles);
|
const res = await flattenUpdates(config, packageFiles);
|
||||||
expect(res).toMatchSnapshot();
|
expect(res).toMatchSnapshot();
|
||||||
|
|
Loading…
Reference in a new issue