Skip to content
Snippets Groups Projects
Unverified Commit b8b435b0 authored by Rhys Arkins's avatar Rhys Arkins Committed by GitHub
Browse files

feat(npm): support binarySource=docker (#4150)

parent eee428f9
No related merge requests found
......@@ -64,6 +64,20 @@ async function generateLockFile(
if (binarySource === 'global') {
cmd = 'npm';
}
// istanbul ignore if
if (config.binarySource === 'docker') {
logger.info('Running npm via docker');
cmd = `docker run --rm `;
const volumes = [cwd];
if (config.cacheDir) {
volumes.push(config.cacheDir);
}
cmd += volumes.map(v => `-v ${v}:${v} `).join('');
const envVars = ['NPM_CONFIG_CACHE', 'npm_config_store'];
cmd += envVars.map(e => `-e ${e} `).join('');
cmd += `-w ${cwd} `;
cmd += `renovate/npm npm`;
}
args = `install`;
if (
(postUpdateOptions && postUpdateOptions.includes('npmDedupe')) ||
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment