jenkins/common: prevent cleaning when directory is not existing

Signed-off-by: Marc Mattmueller <marc.mattmueller@netmodule.com>
This commit is contained in:
Marc Mattmueller 2021-10-05 10:22:52 +02:00
parent c40dcce3d5
commit d530642b18
1 changed files with 2 additions and 2 deletions

View File

@ -26,8 +26,8 @@ echo "loading common yocto build module..."
def cleanWorkspace() {
println "cleaning workspace..."
sh "find \"${WORKSPACE}/build-common/sstate-cache/\" -name \"sstate*\" -atime +3 -delete"
sh "find \"${env.SHARED_BUILD}/tmp/work/\" -name temp -type d -exec rm -rf {} +"
sh "[[ -d \"${WORKSPACE}/build-common/sstate-cache\" ]] && find \"${WORKSPACE}/build-common/sstate-cache/\" -name \"sstate*\" -atime +3 -delete || true"
sh "[[ -d \"${env.SHARED_BUILD}/tmp/work\" ]] && find \"${env.SHARED_BUILD}/tmp/work/\" -name temp -type d -exec rm -rf {} + || true"
}