diff --git a/tests/CI/gates.jenkinsfile b/tests/CI/gates.jenkinsfile index 284b0feab3..e52d3a4cd3 100644 --- a/tests/CI/gates.jenkinsfile +++ b/tests/CI/gates.jenkinsfile @@ -240,8 +240,10 @@ pipeline { } post { cleanup { - if (env.CLEANUP_WS_GATES.toBoolean()) { - cleanWs deleteDirs: true, notFailBuild: false + script { + if (env.CLEANUP_WS_GATES.toBoolean()) { + cleanWs deleteDirs: true, notFailBuild: false + } } } /* diff --git a/tests/CI/periodics-daily.jenkinsfile b/tests/CI/periodics-daily.jenkinsfile index 4934c12141..11e9ed379a 100644 --- a/tests/CI/periodics-daily.jenkinsfile +++ b/tests/CI/periodics-daily.jenkinsfile @@ -159,8 +159,10 @@ pipeline { } post { cleanup { - if (env.CLEANUP_WS_DAILIES.toBoolean()) { - cleanWs deleteDirs: true, notFailBuild: false + script { + if (env.CLEANUP_WS_DAILIES.toBoolean()) { + cleanWs deleteDirs: true, notFailBuild: false + } } } success { diff --git a/tests/CI/ref_debug.jenkinsfile b/tests/CI/ref_debug.jenkinsfile index a2bfdbaead..31fc85d4d9 100644 --- a/tests/CI/ref_debug.jenkinsfile +++ b/tests/CI/ref_debug.jenkinsfile @@ -129,8 +129,10 @@ pipeline { } post { cleanup { - if (env.CLEANUP_WS_REF_DEBUG.toBoolean()) { - cleanWs deleteDirs: true, notFailBuild: false + script { + if (env.CLEANUP_WS_REF_DEBUG.toBoolean()) { + cleanWs deleteDirs: true, notFailBuild: false + } } } success {