Skip to content

Commit

Permalink
feat: centralized cache directory (#10115)
Browse files Browse the repository at this point in the history
Ignore environment variables and instead use static cache directory for third party tools.

Closes #10094

BREAKING CHANGE: Renovate will now override any package manager cache locations configured in env variables.
  • Loading branch information
rarkins authored Jul 28, 2021
1 parent 8d1f5f4 commit b061522
Show file tree
Hide file tree
Showing 15 changed files with 40 additions and 120 deletions.
5 changes: 1 addition & 4 deletions lib/manager/bundler/artifacts.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,7 @@ describe('bundler.updateArtifacts()', () => {
docker.resetPrefetchedImages();

setAdminConfig(adminConfig);

fs.ensureCacheDir.mockResolvedValueOnce(
join(adminConfig.cacheDir, './others/gem')
);
fs.ensureCacheDir.mockResolvedValue('/tmp/cache/others/gem');
});
afterEach(() => {
setAdminConfig();
Expand Down
4 changes: 1 addition & 3 deletions lib/manager/bundler/artifacts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,11 @@ export async function updateArtifacts(
);
}

const cacheDir = await ensureCacheDir('./others/gem', 'GEM_HOME');

const execOptions: ExecOptions = {
cwdFile: packageFileName,
extraEnv: {
...bundlerHostRulesVariables,
GEM_HOME: cacheDir,
GEM_HOME: await ensureCacheDir('bundler'),
},
docker: {
image: 'ruby',
Expand Down
4 changes: 1 addition & 3 deletions lib/manager/cocoapods/artifacts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,11 @@ export async function updateArtifacts({
);
const tagConstraint = match?.groups?.cocoapodsVersion ?? null;

const cacheDir = await ensureCacheDir('./others/cocoapods', 'CP_HOME_DIR');

const cmd = [...getPluginCommands(newPackageFileContent), 'pod install'];
const execOptions: ExecOptions = {
cwdFile: packageFileName,
extraEnv: {
CP_HOME_DIR: cacheDir,
CP_HOME_DIR: await ensureCacheDir('cocoapods'),
},
docker: {
image: 'cocoapods',
Expand Down
4 changes: 1 addition & 3 deletions lib/manager/composer/artifacts.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ describe('.updateArtifacts()', () => {
docker.resetPrefetchedImages();
hostRules.clear();
setAdminConfig(adminConfig);
fs.ensureCacheDir.mockResolvedValue(
join(adminConfig.cacheDir, './others/composer')
);
fs.ensureCacheDir.mockResolvedValue('/tmp/renovate/cache/others/composer');
});
afterEach(() => {
setAdminConfig();
Expand Down
7 changes: 1 addition & 6 deletions lib/manager/composer/artifacts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,6 @@ export async function updateArtifacts({
}: UpdateArtifact): Promise<UpdateArtifactsResult[] | null> {
logger.debug(`composer.updateArtifacts(${packageFileName})`);

const cacheDir = await ensureCacheDir(
'./others/composer',
'COMPOSER_CACHE_DIR'
);

const lockFileName = packageFileName.replace(/\.json$/, '.lock');
const existingLockFileContent = await readLocalFile(lockFileName);
if (!existingLockFileContent) {
Expand All @@ -100,7 +95,7 @@ export async function updateArtifacts({
const execOptions: ExecOptions = {
cwdFile: packageFileName,
extraEnv: {
COMPOSER_CACHE_DIR: cacheDir,
COMPOSER_CACHE_DIR: await ensureCacheDir('composer'),
COMPOSER_AUTH: getAuthJson(),
},
docker: {
Expand Down
16 changes: 8 additions & 8 deletions lib/manager/gomod/__snapshots__/artifacts.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Array [
},
},
Object {
"cmd": "docker run --rm --name=renovate_go --label=renovate_child -v \\"/tmp/github/some/repo\\":\\"/tmp/github/some/repo\\" -v \\"/tmp/renovate/cache\\":\\"/tmp/renovate/cache\\" -v \\"/tmp/renovate/cache/others/go\\":\\"/tmp/renovate/cache/others/go\\" -e GOPATH -e GOPROXY -e GOPRIVATE -e GONOPROXY -e GONOSUMDB -e GOFLAGS -e CGO_ENABLED -w \\"/tmp/github/some/repo\\" renovate/go:latest bash -l -c \\"go get -d ./...\\"",
"cmd": "docker run --rm --name=renovate_go --label=renovate_child -v \\"/tmp/github/some/repo\\":\\"/tmp/github/some/repo\\" -v \\"/tmp/renovate/cache\\":\\"/tmp/renovate/cache\\" -e GOPATH -e GOPROXY -e GOPRIVATE -e GONOPROXY -e GONOSUMDB -e GOFLAGS -e CGO_ENABLED -w \\"/tmp/github/some/repo\\" renovate/go:latest bash -l -c \\"go get -d ./...\\"",
"options": Object {
"cwd": "/tmp/github/some/repo",
"encoding": "utf-8",
Expand Down Expand Up @@ -326,7 +326,7 @@ Array [
},
},
Object {
"cmd": "docker run --rm --name=renovate_go --label=renovate_child -v \\"/tmp/github/some/repo\\":\\"/tmp/github/some/repo\\" -v \\"/tmp/renovate/cache\\":\\"/tmp/renovate/cache\\" -v \\"/tmp/renovate/cache/others/go\\":\\"/tmp/renovate/cache/others/go\\" -e GOPATH -e GOPROXY -e GOPRIVATE -e GONOPROXY -e GONOSUMDB -e GOFLAGS -e CGO_ENABLED -e GIT_CONFIG_COUNT -w \\"/tmp/github/some/repo\\" renovate/go:latest bash -l -c \\"go get -d ./...\\"",
"cmd": "docker run --rm --name=renovate_go --label=renovate_child -v \\"/tmp/github/some/repo\\":\\"/tmp/github/some/repo\\" -v \\"/tmp/renovate/cache\\":\\"/tmp/renovate/cache\\" -e GOPATH -e GOPROXY -e GOPRIVATE -e GONOPROXY -e GONOSUMDB -e GOFLAGS -e CGO_ENABLED -e GIT_CONFIG_COUNT -w \\"/tmp/github/some/repo\\" renovate/go:latest bash -l -c \\"go get -d ./...\\"",
"options": Object {
"cwd": "/tmp/github/some/repo",
"encoding": "utf-8",
Expand Down Expand Up @@ -369,7 +369,7 @@ Array [
},
},
Object {
"cmd": "docker run --rm --name=renovate_go --label=renovate_child -v \\"/tmp/github/some/repo\\":\\"/tmp/github/some/repo\\" -v \\"/tmp/renovate/cache\\":\\"/tmp/renovate/cache\\" -v \\"/tmp/renovate/cache/others/go\\":\\"/tmp/renovate/cache/others/go\\" -e GOPATH -e GOPROXY -e GOPRIVATE -e GONOPROXY -e GONOSUMDB -e GOFLAGS -e CGO_ENABLED -e GIT_CONFIG_KEY_0 -e GIT_CONFIG_VALUE_0 -e GIT_CONFIG_COUNT -w \\"/tmp/github/some/repo\\" renovate/go:latest bash -l -c \\"go get -d ./...\\"",
"cmd": "docker run --rm --name=renovate_go --label=renovate_child -v \\"/tmp/github/some/repo\\":\\"/tmp/github/some/repo\\" -v \\"/tmp/renovate/cache\\":\\"/tmp/renovate/cache\\" -e GOPATH -e GOPROXY -e GOPRIVATE -e GONOPROXY -e GONOSUMDB -e GOFLAGS -e CGO_ENABLED -e GIT_CONFIG_KEY_0 -e GIT_CONFIG_VALUE_0 -e GIT_CONFIG_COUNT -w \\"/tmp/github/some/repo\\" renovate/go:latest bash -l -c \\"go get -d ./...\\"",
"options": Object {
"cwd": "/tmp/github/some/repo",
"encoding": "utf-8",
Expand Down Expand Up @@ -414,7 +414,7 @@ Array [
},
},
Object {
"cmd": "docker run --rm --name=renovate_go --label=renovate_child -v \\"/tmp/github/some/repo\\":\\"/tmp/github/some/repo\\" -v \\"/tmp/renovate/cache\\":\\"/tmp/renovate/cache\\" -v \\"/tmp/renovate/cache/others/go\\":\\"/tmp/renovate/cache/others/go\\" -e GOPATH -e GOPROXY -e GOPRIVATE -e GONOPROXY -e GONOSUMDB -e GOFLAGS -e CGO_ENABLED -e GIT_CONFIG_KEY_0 -e GIT_CONFIG_VALUE_0 -e GIT_CONFIG_COUNT -w \\"/tmp/github/some/repo\\" renovate/go:latest bash -l -c \\"go get -d ./...\\"",
"cmd": "docker run --rm --name=renovate_go --label=renovate_child -v \\"/tmp/github/some/repo\\":\\"/tmp/github/some/repo\\" -v \\"/tmp/renovate/cache\\":\\"/tmp/renovate/cache\\" -e GOPATH -e GOPROXY -e GOPRIVATE -e GONOPROXY -e GONOSUMDB -e GOFLAGS -e CGO_ENABLED -e GIT_CONFIG_KEY_0 -e GIT_CONFIG_VALUE_0 -e GIT_CONFIG_COUNT -w \\"/tmp/github/some/repo\\" renovate/go:latest bash -l -c \\"go get -d ./...\\"",
"options": Object {
"cwd": "/tmp/github/some/repo",
"encoding": "utf-8",
Expand Down Expand Up @@ -459,7 +459,7 @@ Array [
},
},
Object {
"cmd": "docker run --rm --name=renovate_go --label=renovate_child -v \\"/tmp/github/some/repo\\":\\"/tmp/github/some/repo\\" -v \\"/tmp/renovate/cache\\":\\"/tmp/renovate/cache\\" -v \\"/tmp/renovate/cache/others/go\\":\\"/tmp/renovate/cache/others/go\\" -e GOPATH -e GOPROXY -e GOPRIVATE -e GONOPROXY -e GONOSUMDB -e GOFLAGS -e CGO_ENABLED -e GIT_CONFIG_KEY_0 -e GIT_CONFIG_VALUE_0 -e GIT_CONFIG_COUNT -e GIT_CONFIG_KEY_1 -e GIT_CONFIG_VALUE_1 -e GIT_CONFIG_KEY_2 -e GIT_CONFIG_VALUE_2 -e GIT_CONFIG_KEY_3 -e GIT_CONFIG_VALUE_3 -e GIT_CONFIG_KEY_4 -e GIT_CONFIG_VALUE_4 -w \\"/tmp/github/some/repo\\" renovate/go:latest bash -l -c \\"go get -d ./...\\"",
"cmd": "docker run --rm --name=renovate_go --label=renovate_child -v \\"/tmp/github/some/repo\\":\\"/tmp/github/some/repo\\" -v \\"/tmp/renovate/cache\\":\\"/tmp/renovate/cache\\" -e GOPATH -e GOPROXY -e GOPRIVATE -e GONOPROXY -e GONOSUMDB -e GOFLAGS -e CGO_ENABLED -e GIT_CONFIG_KEY_0 -e GIT_CONFIG_VALUE_0 -e GIT_CONFIG_COUNT -e GIT_CONFIG_KEY_1 -e GIT_CONFIG_VALUE_1 -e GIT_CONFIG_KEY_2 -e GIT_CONFIG_VALUE_2 -e GIT_CONFIG_KEY_3 -e GIT_CONFIG_VALUE_3 -e GIT_CONFIG_KEY_4 -e GIT_CONFIG_VALUE_4 -w \\"/tmp/github/some/repo\\" renovate/go:latest bash -l -c \\"go get -d ./...\\"",
"options": Object {
"cwd": "/tmp/github/some/repo",
"encoding": "utf-8",
Expand Down Expand Up @@ -512,7 +512,7 @@ Array [
},
},
Object {
"cmd": "docker run --rm --name=renovate_go --label=renovate_child -v \\"/tmp/github/some/repo\\":\\"/tmp/github/some/repo\\" -v \\"/tmp/renovate/cache\\":\\"/tmp/renovate/cache\\" -v \\"/tmp/renovate/cache/others/go\\":\\"/tmp/renovate/cache/others/go\\" -e GOPATH -e GOPROXY -e GOPRIVATE -e GONOPROXY -e GONOSUMDB -e GOFLAGS -e CGO_ENABLED -w \\"/tmp/github/some/repo\\" renovate/go:latest bash -l -c \\"go get -d ./... && go mod tidy && go mod tidy\\"",
"cmd": "docker run --rm --name=renovate_go --label=renovate_child -v \\"/tmp/github/some/repo\\":\\"/tmp/github/some/repo\\" -v \\"/tmp/renovate/cache\\":\\"/tmp/renovate/cache\\" -e GOPATH -e GOPROXY -e GOPRIVATE -e GONOPROXY -e GONOSUMDB -e GOFLAGS -e CGO_ENABLED -w \\"/tmp/github/some/repo\\" renovate/go:latest bash -l -c \\"go get -d ./... && go mod tidy && go mod tidy\\"",
"options": Object {
"cwd": "/tmp/github/some/repo",
"encoding": "utf-8",
Expand Down Expand Up @@ -554,7 +554,7 @@ Array [
},
},
Object {
"cmd": "docker run --rm --name=renovate_go --label=renovate_child -v \\"/tmp/github/some/repo\\":\\"/tmp/github/some/repo\\" -v \\"/tmp/renovate/cache\\":\\"/tmp/renovate/cache\\" -v \\"/tmp/renovate/cache/others/go\\":\\"/tmp/renovate/cache/others/go\\" -e GOPATH -e GOPROXY -e GONOPROXY -e GONOSUMDB -e GOFLAGS -e CGO_ENABLED -w \\"/tmp/github/some/repo\\" renovate/go:latest bash -l -c \\"go get -d ./...\\"",
"cmd": "docker run --rm --name=renovate_go --label=renovate_child -v \\"/tmp/github/some/repo\\":\\"/tmp/github/some/repo\\" -v \\"/tmp/renovate/cache\\":\\"/tmp/renovate/cache\\" -e GOPATH -e GOPROXY -e GONOPROXY -e GONOSUMDB -e GOFLAGS -e CGO_ENABLED -w \\"/tmp/github/some/repo\\" renovate/go:latest bash -l -c \\"go get -d ./...\\"",
"options": Object {
"cwd": "/tmp/github/some/repo",
"encoding": "utf-8",
Expand Down Expand Up @@ -595,7 +595,7 @@ Array [
},
},
Object {
"cmd": "docker run --rm --name=renovate_go --label=renovate_child -v \\"/tmp/github/some/repo\\":\\"/tmp/github/some/repo\\" -v \\"/tmp/renovate/cache\\":\\"/tmp/renovate/cache\\" -v \\"/tmp/renovate/cache/others/go\\":\\"/tmp/renovate/cache/others/go\\" -e GOPATH -e GOPROXY -e GOPRIVATE -e GONOPROXY -e GONOSUMDB -e GOFLAGS -e CGO_ENABLED -w \\"/tmp/github/some/repo\\" renovate/go:latest bash -l -c \\"go get -d ./...\\"",
"cmd": "docker run --rm --name=renovate_go --label=renovate_child -v \\"/tmp/github/some/repo\\":\\"/tmp/github/some/repo\\" -v \\"/tmp/renovate/cache\\":\\"/tmp/renovate/cache\\" -e GOPATH -e GOPROXY -e GOPRIVATE -e GONOPROXY -e GONOSUMDB -e GOFLAGS -e CGO_ENABLED -w \\"/tmp/github/some/repo\\" renovate/go:latest bash -l -c \\"go get -d ./...\\"",
"options": Object {
"cwd": "/tmp/github/some/repo",
"encoding": "utf-8",
Expand Down
5 changes: 1 addition & 4 deletions lib/manager/gomod/artifacts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,6 @@ export async function updateArtifacts({
}: UpdateArtifact): Promise<UpdateArtifactsResult[] | null> {
logger.debug(`gomod.updateArtifacts(${goModFileName})`);

const goPath = await ensureCacheDir('./others/go', 'GOPATH');

const sumFileName = goModFileName.replace(/\.mod$/, '.sum');
const existingGoSumContent = await readLocalFile(sumFileName);
if (!existingGoSumContent) {
Expand Down Expand Up @@ -165,7 +163,7 @@ export async function updateArtifacts({
const execOptions: ExecOptions = {
cwdFile: goModFileName,
extraEnv: {
GOPATH: goPath,
GOPATH: await ensureCacheDir('go'),
GOPROXY: process.env.GOPROXY,
GOPRIVATE: goPrivate,
GONOPROXY: process.env.GONOPROXY,
Expand All @@ -178,7 +176,6 @@ export async function updateArtifacts({
image: 'go',
tagConstraint: config.constraints?.go,
tagScheme: 'npm',
volumes: [goPath],
},
};

Expand Down
19 changes: 9 additions & 10 deletions lib/manager/npm/post-update/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -420,16 +420,15 @@ export async function getAdditionalFiles(

const { additionalNpmrcContent, additionalYarnRcYml } = processHostRules();

const env = {
...getChildProcessEnv(),
NPM_CONFIG_CACHE: await ensureCacheDir('./others/npm', 'NPM_CONFIG_CACHE'),
YARN_CACHE_FOLDER: await ensureCacheDir(
'./others/yarn',
'YARN_CACHE_FOLDER'
),
npm_config_store: await ensureCacheDir('./others/pnpm', 'npm_config_store'),
NODE_ENV: 'dev',
};
const env = getChildProcessEnv([
'NPM_CONFIG_CACHE',
'YARN_CACHE_FOLDER',
'npm_config_store',
]);
env.NPM_CONFIG_CACHE = await ensureCacheDir('npm');
env.YARN_CACHE_FOLDER = await ensureCacheDir('yarn');
env.npm_config_store = await ensureCacheDir('pnpm');
env.NODE_ENV = 'dev';

let token = '';
try {
Expand Down
2 changes: 1 addition & 1 deletion lib/manager/nuget/artifacts.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ describe('updateArtifacts', () => {
getDefaultRegistries.mockReturnValue([] as any);
env.getChildProcessEnv.mockReturnValue(envMock.basic);
fs.ensureCacheDir.mockImplementation((dirName: string) =>
Promise.resolve(dirName)
Promise.resolve(`others/${dirName}`)
);
getRandomString.mockReturnValue('not-so-random' as any);
setAdminConfig(adminConfig);
Expand Down
7 changes: 3 additions & 4 deletions lib/manager/nuget/artifacts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,9 @@ async function runDotnetRestore(
},
};

const nugetConfigDir = await ensureCacheDir(
`./others/nuget/${getRandomString()}`
);
const nugetConfigFile = join(nugetConfigDir, 'nuget.config');
const nugetCacheDir = await ensureCacheDir('nuget');
const nugetConfigDir = join(nugetCacheDir, `${getRandomString()}`);
const nugetConfigFile = join(nugetConfigDir, `nuget.config`);
await outputFile(
nugetConfigFile,
`<?xml version="1.0" encoding="utf-8"?>\n<configuration>\n</configuration>\n`
Expand Down
3 changes: 1 addition & 2 deletions lib/manager/pip_setup/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ export async function getExtractFile(): Promise<string> {
return extractPy;
}

const cacheDir = await ensureCacheDir('./others/pip_setup');
extractPy = join(cacheDir, EXTRACT);
extractPy = join(await ensureCacheDir('pip_setup'), EXTRACT);
await outputFile(extractPy, dataFiles.get('data/extract.py'));

return extractPy;
Expand Down
8 changes: 4 additions & 4 deletions lib/manager/pipenv/__snapshots__/artifacts.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ Array [
},
},
Object {
"cmd": "docker run --rm --name=renovate_python --label=renovate_child -v \\"/tmp/github/some/repo\\":\\"/tmp/github/some/repo\\" -v \\"/tmp/renovate/cache\\":\\"/tmp/renovate/cache\\" -v \\"/tmp/renovate/cache/others/pipenv\\":\\"/tmp/renovate/cache/others/pipenv\\" -e PIPENV_CACHE_DIR -w \\"/tmp/github/some/repo\\" renovate/python:latest bash -l -c \\"pip install --user pipenv && pipenv lock\\"",
"cmd": "docker run --rm --name=renovate_python --label=renovate_child -v \\"/tmp/github/some/repo\\":\\"/tmp/github/some/repo\\" -v \\"/tmp/renovate/cache\\":\\"/tmp/renovate/cache\\" -e PIPENV_CACHE_DIR -w \\"/tmp/github/some/repo\\" renovate/python:latest bash -l -c \\"pip install --user pipenv && pipenv lock\\"",
"options": Object {
"cwd": "/tmp/github/some/repo",
"encoding": "utf-8",
Expand Down Expand Up @@ -158,7 +158,7 @@ Array [
},
},
Object {
"cmd": "docker run --rm --name=renovate_python --label=renovate_child -v \\"/tmp/github/some/repo\\":\\"/tmp/github/some/repo\\" -v \\"/tmp/renovate/cache\\":\\"/tmp/renovate/cache\\" -v \\"/tmp/renovate/cache/others/pipenv\\":\\"/tmp/renovate/cache/others/pipenv\\" -e PIPENV_CACHE_DIR -w \\"/tmp/github/some/repo\\" renovate/python bash -l -c \\"pip install --user pipenv==2020.8.13 && pipenv lock\\"",
"cmd": "docker run --rm --name=renovate_python --label=renovate_child -v \\"/tmp/github/some/repo\\":\\"/tmp/github/some/repo\\" -v \\"/tmp/renovate/cache\\":\\"/tmp/renovate/cache\\" -e PIPENV_CACHE_DIR -w \\"/tmp/github/some/repo\\" renovate/python bash -l -c \\"pip install --user pipenv==2020.8.13 && pipenv lock\\"",
"options": Object {
"cwd": "/tmp/github/some/repo",
"encoding": "utf-8",
Expand Down Expand Up @@ -194,7 +194,7 @@ Array [
},
},
Object {
"cmd": "docker run --rm --name=renovate_python --label=renovate_child -v \\"/tmp/github/some/repo\\":\\"/tmp/github/some/repo\\" -v \\"/tmp/renovate/cache\\":\\"/tmp/renovate/cache\\" -v \\"/tmp/renovate/cache/others/pipenv\\":\\"/tmp/renovate/cache/others/pipenv\\" -e PIPENV_CACHE_DIR -w \\"/tmp/github/some/repo\\" renovate/python bash -l -c \\"pip install --user pipenv==2020.8.13 && pipenv lock\\"",
"cmd": "docker run --rm --name=renovate_python --label=renovate_child -v \\"/tmp/github/some/repo\\":\\"/tmp/github/some/repo\\" -v \\"/tmp/renovate/cache\\":\\"/tmp/renovate/cache\\" -e PIPENV_CACHE_DIR -w \\"/tmp/github/some/repo\\" renovate/python bash -l -c \\"pip install --user pipenv==2020.8.13 && pipenv lock\\"",
"options": Object {
"cwd": "/tmp/github/some/repo",
"encoding": "utf-8",
Expand Down Expand Up @@ -230,7 +230,7 @@ Array [
},
},
Object {
"cmd": "docker run --rm --name=renovate_python --label=renovate_child -v \\"/tmp/github/some/repo\\":\\"/tmp/github/some/repo\\" -v \\"/tmp/renovate/cache\\":\\"/tmp/renovate/cache\\" -v \\"/tmp/renovate/cache/others/pipenv\\":\\"/tmp/renovate/cache/others/pipenv\\" -e PIPENV_CACHE_DIR -w \\"/tmp/github/some/repo\\" renovate/python bash -l -c \\"pip install --user pipenv==2020.1.1 && pipenv lock\\"",
"cmd": "docker run --rm --name=renovate_python --label=renovate_child -v \\"/tmp/github/some/repo\\":\\"/tmp/github/some/repo\\" -v \\"/tmp/renovate/cache\\":\\"/tmp/renovate/cache\\" -e PIPENV_CACHE_DIR -w \\"/tmp/github/some/repo\\" renovate/python bash -l -c \\"pip install --user pipenv==2020.1.1 && pipenv lock\\"",
"options": Object {
"cwd": "/tmp/github/some/repo",
"encoding": "utf-8",
Expand Down
5 changes: 1 addition & 4 deletions lib/manager/pipenv/artifacts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ export async function updateArtifacts({
}: UpdateArtifact): Promise<UpdateArtifactsResult[] | null> {
logger.debug(`pipenv.updateArtifacts(${pipfileName})`);

const cacheDir = await ensureCacheDir('./others/pipenv', 'PIPENV_CACHE_DIR');

const lockFileName = pipfileName + '.lock';
const existingLockFileContent = await readLocalFile(lockFileName, 'utf8');
if (!existingLockFileContent) {
Expand All @@ -99,7 +97,7 @@ export async function updateArtifacts({
const execOptions: ExecOptions = {
cwdFile: pipfileName,
extraEnv: {
PIPENV_CACHE_DIR: cacheDir,
PIPENV_CACHE_DIR: await ensureCacheDir('pipenv'),
},
docker: {
image: 'python',
Expand All @@ -108,7 +106,6 @@ export async function updateArtifacts({
preCommands: [
`pip install --user ${quote(`pipenv${pipenvConstraint}`)}`,
],
volumes: [cacheDir],
},
};
logger.debug({ cmd }, 'pipenv lock command');
Expand Down
Loading

0 comments on commit b061522

Please sign in to comment.