diff --git a/first-class-pipeline/src/com/freeleaps/devops/DependenciesResolver.groovy b/first-class-pipeline/src/com/freeleaps/devops/DependenciesResolver.groovy index 355d5714..8df962ca 100644 --- a/first-class-pipeline/src/com/freeleaps/devops/DependenciesResolver.groovy +++ b/first-class-pipeline/src/com/freeleaps/devops/DependenciesResolver.groovy @@ -60,8 +60,10 @@ class DependenciesResolver { if (cachingEnabled) { steps.dir(this.workspace) { - steps.cache(maxCacheSize: 512, caches: [[$class: 'ArbitraryFileCache', cacheName: "${configurations.name}-pip-cache", includes: '**/*', path: '.pip-cache', cacheValidityDecidingFile: 'requirements.txt']]) { - steps.sh "pip install --cache-dir .pip-cache -r ${requirementsFile}" + steps.cache(maxCacheSize: 512, caches: [[$class: 'ArbitraryFileCache', includes: '**/*', path: ".${configurations.name}-pip-cache", cacheValidityDecidingFile: 'requirements.txt']]) { + steps.sh "mkdir -p .${configurations.name}-pip-cache" + steps.sh "pip config set global.cache-dir '${this.workspace}/.${configurations.name}-pip-cache'" + steps.sh "pip install --cache-dir .${configurations.name}-pip-cache -r ${requirementsFile}" } } } else { @@ -82,8 +84,9 @@ class DependenciesResolver { if (cachingEnabled) { steps.dir(this.workspace) { - steps.cache(maxCacheSize: 512, caches: [[$class: 'ArbitraryFileCache', cacheName: "${configurations.name}-npm-cache", includes: '**/*', path: '.npm-cache', cacheValidityDecidingFile: 'package-lock.json']]) { - steps.sh "npm install --cache .npm-cache --prefer-offline --no-audit" + steps.cache(maxCacheSize: 512, caches: [[$class: 'ArbitraryFileCache', includes: '**/*', path: ".${configurations.name}-npm-cache", cacheValidityDecidingFile: 'package-lock.json']]) { + steps.sh "mkdir -p .${configurations.name}-npm-cache" + steps.sh "npm install --cache .${configurations.name}-npm-cache --prefer-offline --no-audit" } } } else { @@ -104,8 +107,9 @@ class DependenciesResolver { if (cachingEnabled) { steps.dir(this.workspace) { - steps.cache(maxCacheSize: 512, caches: [[$class: 'ArbitraryFileCache', includes: '**/*', cacheName: "${configurations.name}-pnpm-cache", path: '.yarn-cache', cacheValidityDecidingFile: 'yarn.lock']]) { - steps.sh "yarn install --cache-folder .yarn-cache --prefer-offline" + steps.cache(maxCacheSize: 512, caches: [[$class: 'ArbitraryFileCache', includes: '**/*', path: ".${configurations.name}-yarn-cache", cacheValidityDecidingFile: 'yarn.lock']]) { + steps.sh "mkdir -p ${configurations.name}-pnpm-cache" + steps.sh "yarn install --cache-folder ${configurations.name}-pnpm-cache --prefer-offline" } } } else {