fix(caching): add logging for cache restoration in npm and yarn installations
Signed-off-by: 孙振宇 <>
This commit is contained in:
parent
6810be5cd8
commit
d6e3008c6e
@ -65,7 +65,9 @@ class DependenciesResolver {
|
||||
|
||||
if (cachingEnabled) {
|
||||
steps.dir(this.workspace) {
|
||||
steps.cache(maxCacheSize: 512, caches: [[$class: 'ArbitraryFileCache', includes: '**/*', path: '.npm-cache', cacheValidityDecidingFile: 'package-lock.json']])
|
||||
steps.cache(maxCacheSize: 512, caches: [[$class: 'ArbitraryFileCache', includes: '**/*', path: '.npm-cache', cacheValidityDecidingFile: 'package-lock.json']]) {
|
||||
steps.log.info("Dependencies Resolver","Caches are restored")
|
||||
}
|
||||
def cacheExists = steps.fileExists('.npm-cache')
|
||||
if (!cacheExists) {
|
||||
steps.sh "npm install --cache .npm-cache"
|
||||
@ -89,7 +91,9 @@ class DependenciesResolver {
|
||||
|
||||
if (cachingEnabled) {
|
||||
steps.dir(this.workspace) {
|
||||
steps.cache(maxCacheSize: 512, caches: [[$class: 'ArbitraryFileCache', includes: '**/*', path: '.yarn-cache', cacheValidityDecidingFile: 'yarn.lock']])
|
||||
steps.cache(maxCacheSize: 512, caches: [[$class: 'ArbitraryFileCache', includes: '**/*', path: '.yarn-cache', cacheValidityDecidingFile: 'yarn.lock']]) {
|
||||
steps.log.info("Dependencies Resolver","Caches are restored")
|
||||
}
|
||||
def cacheExists = steps.fileExists('.yarn-cache')
|
||||
if (!cacheExists) {
|
||||
steps.sh "yarn install --cache-folder .yarn-cache"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user