diff --git a/first-class-pipeline/src/com/freeleaps/devops/DependenciesResolver.groovy b/first-class-pipeline/src/com/freeleaps/devops/DependenciesResolver.groovy index 46f58f5b..f0205579 100644 --- a/first-class-pipeline/src/com/freeleaps/devops/DependenciesResolver.groovy +++ b/first-class-pipeline/src/com/freeleaps/devops/DependenciesResolver.groovy @@ -85,9 +85,9 @@ class DependenciesResolver { if (cachingEnabled) { steps.dir(this.workspace) { - steps.cache(maxCacheSize: 512, caches: [[$class: 'ArbitraryFileCache', includes: '**/*', path: "/tmp/.${configurations.name}-npm-cache", cacheValidityDecidingFile: 'package-lock.json']]) { - steps.sh "mkdir -p /tmp/.${configurations.name}-npm-cache" - steps.sh "npm install --cache /tmp/.${configurations.name}-npm-cache --prefer-offline --no-audit" + steps.cache(maxCacheSize: 512, caches: [[$class: 'ArbitraryFileCache', includes: '**/*', path: "${steps.env.WORKSPACE}/.${configurations.name}-npm-cache", cacheValidityDecidingFile: 'package-lock.json']]) { + steps.sh "mkdir -p ${steps.env.WORKSPACE}/.${configurations.name}-npm-cache" + steps.sh "npm install --cache ${steps.env.WORKSPACE}/.${configurations.name}-npm-cache --prefer-offline --no-audit" } } } else { @@ -111,9 +111,9 @@ class DependenciesResolver { if (cachingEnabled) { steps.dir(this.workspace) { - steps.cache(maxCacheSize: 512, caches: [[$class: 'ArbitraryFileCache', includes: '**/*', path: "/tmp/.${configurations.name}-yarn-cache", cacheValidityDecidingFile: 'yarn.lock']]) { - steps.sh "mkdir -p /tmp/.${configurations.name}-pnpm-cache" - steps.sh "yarn install --cache-folder /tmp/.${configurations.name}-pnpm-cache --prefer-offline" + steps.cache(maxCacheSize: 512, caches: [[$class: 'ArbitraryFileCache', includes: '**/*', path: "${steps.env.WORKSPACE}/.${configurations.name}-yarn-cache", cacheValidityDecidingFile: 'yarn.lock']]) { + steps.sh "mkdir -p ${steps.env.WORKSPACE}/.${configurations.name}-pnpm-cache" + steps.sh "yarn install --cache-folder ${steps.env.WORKSPACE}/.${configurations.name}-pnpm-cache --prefer-offline" } } } else { @@ -137,9 +137,9 @@ class DependenciesResolver { if (cachingEnabled) { steps.dir(this.workspace) { - steps.cache(maxCacheSize: 512, caches: [[$class: 'ArbitraryFileCache', includes: '**/*', path: "/tmp/.${configurations.name}-pnpm-cache", cacheValidityDecidingFile: 'pnpm-lock.yaml']]) { - steps.sh "mkdir -p /tmp/.${configurations.name}-pnpm-cache" - steps.sh "pnpm install --store-dir /tmp/.${configurations.name}-pnpm-cache --prefer-offline" + steps.cache(maxCacheSize: 512, caches: [[$class: 'ArbitraryFileCache', includes: '**/*', path: "${steps.env.WORKSPACE}/.${configurations.name}-pnpm-cache", cacheValidityDecidingFile: 'pnpm-lock.yaml']]) { + steps.sh "mkdir -p ${steps.env.WORKSPACE}/.${configurations.name}-pnpm-cache" + steps.sh "pnpm install --store-dir ${steps.env.WORKSPACE}/.${configurations.name}-pnpm-cache --prefer-offline" } } } else {