fix(caching): remove redundant logging and streamline cache existence checks for npm and yarn installations
Signed-off-by: 孙振宇 <>
This commit is contained in:
parent
d6e3008c6e
commit
81b3095925
@ -66,11 +66,10 @@ class DependenciesResolver {
|
||||
if (cachingEnabled) {
|
||||
steps.dir(this.workspace) {
|
||||
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"
|
||||
def cacheExists = steps.fileExists('.npm-cache')
|
||||
if (!cacheExists) {
|
||||
steps.sh "npm install --cache .npm-cache"
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@ -92,11 +91,10 @@ class DependenciesResolver {
|
||||
if (cachingEnabled) {
|
||||
steps.dir(this.workspace) {
|
||||
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"
|
||||
def cacheExists = steps.fileExists('.yarn-cache')
|
||||
if (!cacheExists) {
|
||||
steps.sh "yarn install --cache-folder .yarn-cache"
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user