mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-12 23:16: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
22 lines
677 B
JavaScript
22 lines
677 B
JavaScript
const dockerfile = require('../../../lib/workers/branch/dockerfile');
|
|
const logger = require('../../_fixtures/logger');
|
|
|
|
describe('workers/branch/dockerfile', () => {
|
|
describe('setNewValue', () => {
|
|
it('replaces existing value', () => {
|
|
const currentFileContent =
|
|
'# comment FROM node:8\nFROM node:8\nRUN something\n';
|
|
const depName = 'node';
|
|
const currentVersion = 'node:8';
|
|
const newVersion = 'node:8@sha256:abcdefghijklmnop';
|
|
const res = dockerfile.setNewValue(
|
|
currentFileContent,
|
|
depName,
|
|
currentVersion,
|
|
newVersion,
|
|
logger
|
|
);
|
|
expect(res).toMatchSnapshot();
|
|
});
|
|
});
|
|
});
|