Skip to content

Commit e0e649a

Browse files
unDRY it
1 parent b7270c4 commit e0e649a

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

vars/build_stages.groovy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ def deployDocs() {
147147
}
148148

149149
def cleanup() {
150+
sh "${ACTIVATE} && make clean"
151+
sh "rm -rf ${conda_env_path}"
150152
cleanWs()
151153
dir("${WORKSPACE}@tmp") {
152154
deleteDir()

vars/reusable_pipeline.groovy

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,6 @@ def call(Map config = [:]){
165165
if (params.DEBUG) {
166166
echo 'Debug was enabled - MANUALLY CLEAN UP WHEN FINISHED.'
167167
} else {
168-
// Clean up the conda envs
169-
sh "${ACTIVATE} && make clean"
170-
sh "rm -rf ${conda_env_path}"
171-
172168
buildStages.cleanup()
173169
}
174170
}
@@ -242,8 +238,11 @@ def call(Map config = [:]){
242238
}
243239
}
244240
cleanup { // cleanup for outer workspace
245-
script{
246-
buildStages.cleanup()
241+
// NOTE: We always clean up this outer workspace regardless of DEBUG
242+
cleanWs()
243+
// manually remove @tmp dirs
244+
dir("${WORKSPACE}@tmp"){
245+
deleteDir()
247246
}
248247
}
249248
} // End of post

0 commit comments

Comments
 (0)