mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-12 06:56:24 +00:00
feat: drop dockerMapDotFiles (#9417)
Drops support for dockerMapDotfiles BREAKING CHANGE: dockerMapDotfiles is no longer supported
This commit is contained in:
parent
cbf8ea4e55
commit
ac7a5c4d93
11 changed files with 2 additions and 123 deletions
|
@ -164,17 +164,6 @@ You would use put this in your configuration file:
|
|||
|
||||
If you pulled a new `node` image, the final image would be `ghcr.io/renovatebot/node` instead of `docker.io/renovate/node`.
|
||||
|
||||
## dockerMapDotfiles
|
||||
|
||||
This is used if you want to map "dotfiles" from your host computer home directory to containers that Renovate creates, e.g. for updating lock files.
|
||||
Currently applicable to `.npmrc` only.
|
||||
|
||||
```json
|
||||
{
|
||||
"dockerMapDotfiles": true
|
||||
}
|
||||
```
|
||||
|
||||
## dockerUser
|
||||
|
||||
Override default user and group used by Docker-based binaries.
|
||||
|
|
|
@ -254,14 +254,6 @@ const options: RenovateOptions[] = [
|
|||
type: 'object',
|
||||
default: false,
|
||||
},
|
||||
{
|
||||
name: 'dockerMapDotfiles',
|
||||
description:
|
||||
'Map relevant home directory dotfiles into containers when binarySource=docker.',
|
||||
admin: true,
|
||||
type: 'boolean',
|
||||
default: false,
|
||||
},
|
||||
{
|
||||
name: 'dockerChildPrefix',
|
||||
description:
|
||||
|
|
|
@ -236,65 +236,6 @@ Array [
|
|||
]
|
||||
`;
|
||||
|
||||
exports[`manager/npm/post-update/lerna generateLockFiles() maps dot files 1`] = `
|
||||
Array [
|
||||
Object {
|
||||
"cmd": "lerna info || echo \\"Ignoring lerna info failure\\"",
|
||||
"options": Object {
|
||||
"cwd": "some-dir",
|
||||
"encoding": "utf-8",
|
||||
"env": Object {
|
||||
"HOME": "/home/user",
|
||||
"HTTPS_PROXY": "https://example.com",
|
||||
"HTTP_PROXY": "http://example.com",
|
||||
"LANG": "en_US.UTF-8",
|
||||
"LC_ALL": "en_US",
|
||||
"NO_PROXY": "localhost",
|
||||
"PATH": "/tmp/path",
|
||||
},
|
||||
"maxBuffer": 10485760,
|
||||
"timeout": 900000,
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"cmd": "npm install --ignore-scripts --no-audit --package-lock-only",
|
||||
"options": Object {
|
||||
"cwd": "some-dir",
|
||||
"encoding": "utf-8",
|
||||
"env": Object {
|
||||
"HOME": "/home/user",
|
||||
"HTTPS_PROXY": "https://example.com",
|
||||
"HTTP_PROXY": "http://example.com",
|
||||
"LANG": "en_US.UTF-8",
|
||||
"LC_ALL": "en_US",
|
||||
"NO_PROXY": "localhost",
|
||||
"PATH": "/tmp/path",
|
||||
},
|
||||
"maxBuffer": 10485760,
|
||||
"timeout": 900000,
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"cmd": "lerna bootstrap --no-ci --ignore-scripts -- --ignore-scripts --no-audit --package-lock-only",
|
||||
"options": Object {
|
||||
"cwd": "some-dir",
|
||||
"encoding": "utf-8",
|
||||
"env": Object {
|
||||
"HOME": "/home/user",
|
||||
"HTTPS_PROXY": "https://example.com",
|
||||
"HTTP_PROXY": "http://example.com",
|
||||
"LANG": "en_US.UTF-8",
|
||||
"LC_ALL": "en_US",
|
||||
"NO_PROXY": "localhost",
|
||||
"PATH": "/tmp/path",
|
||||
},
|
||||
"maxBuffer": 10485760,
|
||||
"timeout": 900000,
|
||||
},
|
||||
},
|
||||
]
|
||||
`;
|
||||
|
||||
exports[`manager/npm/post-update/lerna generateLockFiles() performs full npm install 1`] = `
|
||||
Array [
|
||||
Object {
|
||||
|
|
|
@ -93,27 +93,13 @@ describe(getName(__filename), () => {
|
|||
expect(res.error).toBe(false);
|
||||
expect(execSnapshots).toMatchSnapshot();
|
||||
});
|
||||
it('maps dot files', async () => {
|
||||
const execSnapshots = mockExecAll(exec);
|
||||
const res = await lernaHelper.generateLockFiles(
|
||||
lernaPkgFile('npm'),
|
||||
'some-dir',
|
||||
{
|
||||
dockerMapDotfiles: true,
|
||||
constraints: { npm: '^6.0.0' },
|
||||
},
|
||||
{}
|
||||
);
|
||||
expect(res.error).toBe(false);
|
||||
expect(execSnapshots).toMatchSnapshot();
|
||||
});
|
||||
it('allows scripts for trust level high', async () => {
|
||||
const execSnapshots = mockExecAll(exec);
|
||||
setAdminConfig({ allowScripts: true });
|
||||
const res = await lernaHelper.generateLockFiles(
|
||||
lernaPkgFile('npm'),
|
||||
'some-dir',
|
||||
{},
|
||||
{ constraints: { npm: '^6.0.0' } },
|
||||
{}
|
||||
);
|
||||
expect(res.error).toBe(false);
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import semver, { validRange } from 'semver';
|
||||
import { quote } from 'shlex';
|
||||
import { join } from 'upath';
|
||||
import { getAdminConfig } from '../../../config/admin';
|
||||
import { TEMPORARY_ERROR } from '../../../constants/error-messages';
|
||||
import { logger } from '../../../logger';
|
||||
|
@ -97,12 +96,6 @@ export async function generateLockFiles(
|
|||
execOptions.extraEnv.NPM_AUTH = env.NPM_AUTH;
|
||||
execOptions.extraEnv.NPM_EMAIL = env.NPM_EMAIL;
|
||||
}
|
||||
if (config.dockerMapDotfiles) {
|
||||
const homeDir =
|
||||
process.env.HOME || process.env.HOMEPATH || process.env.USERPROFILE;
|
||||
const homeNpmrc = join(homeDir, '.npmrc');
|
||||
execOptions.docker.volumes = [[homeNpmrc, '/home/ubuntu/.npmrc']];
|
||||
}
|
||||
const lernaVersion = getLernaVersion(lernaPackageFile);
|
||||
logger.debug('Using lerna version ' + lernaVersion);
|
||||
preCommands.push(`npm i -g lerna@${quote(lernaVersion)}`);
|
||||
|
|
|
@ -27,7 +27,6 @@ describe('generateLockFile', () => {
|
|||
const execSnapshots = mockExecAll(exec);
|
||||
fs.readFile = jest.fn(() => 'package-lock-contents') as never;
|
||||
const artifactUpdateApproach = 'deep';
|
||||
const dockerMapDotfiles = true;
|
||||
const postUpdateOptions = ['npmDedupe'];
|
||||
const updates = [
|
||||
{ depName: 'some-dep', newVersion: '1.0.1', isLockfileUpdate: false },
|
||||
|
@ -36,7 +35,7 @@ describe('generateLockFile', () => {
|
|||
'some-dir',
|
||||
{},
|
||||
'package-lock.json',
|
||||
{ dockerMapDotfiles, artifactUpdateApproach, postUpdateOptions },
|
||||
{ artifactUpdateApproach, postUpdateOptions },
|
||||
updates
|
||||
);
|
||||
expect(fs.readFile).toHaveBeenCalledTimes(1);
|
||||
|
|
|
@ -75,12 +75,6 @@ export async function generateLockFile(
|
|||
execOptions.extraEnv.NPM_AUTH = env.NPM_AUTH;
|
||||
execOptions.extraEnv.NPM_EMAIL = env.NPM_EMAIL;
|
||||
}
|
||||
if (config.dockerMapDotfiles) {
|
||||
const homeDir =
|
||||
process.env.HOME || process.env.HOMEPATH || process.env.USERPROFILE;
|
||||
const homeNpmrc = join(homeDir, '.npmrc');
|
||||
execOptions.docker.volumes = [[homeNpmrc, '/home/ubuntu/.npmrc']];
|
||||
}
|
||||
|
||||
if (!upgrades.every((upgrade) => upgrade.isLockfileUpdate)) {
|
||||
// This command updates the lock file based on package.json
|
||||
|
|
|
@ -24,7 +24,6 @@ describe('generateLockFile', () => {
|
|||
env.getChildProcessEnv.mockReturnValue(envMock.basic);
|
||||
});
|
||||
it('generates lock files', async () => {
|
||||
config.dockerMapDotfiles = true;
|
||||
const execSnapshots = mockExecAll(exec);
|
||||
fs.readFile = jest.fn(() => 'package-lock-contents') as never;
|
||||
const res = await pnpmHelper.generateLockFile('some-dir', {}, config);
|
||||
|
|
|
@ -54,12 +54,6 @@ export async function generateLockFile(
|
|||
execOptions.extraEnv.NPM_AUTH = env.NPM_AUTH;
|
||||
execOptions.extraEnv.NPM_EMAIL = env.NPM_EMAIL;
|
||||
}
|
||||
if (config.dockerMapDotfiles) {
|
||||
const homeDir =
|
||||
process.env.HOME || process.env.HOMEPATH || process.env.USERPROFILE;
|
||||
const homeNpmrc = join(homeDir, '.npmrc');
|
||||
execOptions.docker.volumes = [[homeNpmrc, '/home/ubuntu/.npmrc']];
|
||||
}
|
||||
cmd = 'pnpm';
|
||||
let args = 'install --recursive --lockfile-only';
|
||||
if (!getAdminConfig().allowScripts || config.ignoreScripts) {
|
||||
|
|
|
@ -54,7 +54,6 @@ describe(getName(__filename), () => {
|
|||
);
|
||||
});
|
||||
const config = {
|
||||
dockerMapDotfiles: true,
|
||||
constraints: {
|
||||
yarn: yarnCompatibility,
|
||||
},
|
||||
|
@ -140,7 +139,6 @@ describe(getName(__filename), () => {
|
|||
);
|
||||
});
|
||||
const config = {
|
||||
dockerMapDotfiles: true,
|
||||
constraints: {
|
||||
yarn: yarnCompatibility,
|
||||
},
|
||||
|
|
|
@ -125,12 +125,6 @@ export async function generateLockFile(
|
|||
execOptions.extraEnv.NPM_AUTH = env.NPM_AUTH;
|
||||
execOptions.extraEnv.NPM_EMAIL = env.NPM_EMAIL;
|
||||
}
|
||||
if (config.dockerMapDotfiles) {
|
||||
const homeDir =
|
||||
process.env.HOME || process.env.HOMEPATH || process.env.USERPROFILE;
|
||||
const homeNpmrc = join(homeDir, '.npmrc');
|
||||
execOptions.docker.volumes = [[homeNpmrc, '/home/ubuntu/.npmrc']];
|
||||
}
|
||||
|
||||
// This command updates the lock file based on package.json
|
||||
commands.push(`yarn install ${cmdOptions}`.trim());
|
||||
|
|
Loading…
Reference in a new issue