Skip to content

Commit c2d0a39

Browse files
move debug clean logic from controller to task nodes; fix slack message env path
1 parent b2df959 commit c2d0a39

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

vars/build_stages.groovy

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

149149
def cleanup() {
150-
sh "${ACTIVATE} && make clean"
151-
sh "rm -rf ${conda_env_path}"
152150
cleanWs()
153151
dir("${WORKSPACE}@tmp") {
154152
deleteDir()

vars/reusable_pipeline.groovy

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,17 @@ def call(Map config = [:]){
161161
}
162162
} finally {
163163
// Cleanup
164-
buildStages.cleanup()
164+
script {
165+
if (params.DEBUG) {
166+
echo 'Debug was enabled - MANUALLY CLEAN UP WHEN FINISHED.'
167+
} else {
168+
// Clean up the conda envs
169+
sh "${ACTIVATE} && make clean"
170+
sh "rm -rf ${conda_env_path}"
171+
172+
buildStages.cleanup()
173+
}
174+
}
165175
}
166176
}
167177
}
@@ -205,7 +215,7 @@ def call(Map config = [:]){
205215
slackMessage += """
206216
207217
Debug was enabled - MANUALLY CLEAN UP WHEN FINISHED.
208-
1. Env path: ${env.CONDA_ENV_PATH}
218+
1. Env path: ${conda_env_dir}/${conda_env_name}
209219
2. Workspace: ${env.WORKSPACE}
210220
""".stripIndent()
211221
}
@@ -232,17 +242,7 @@ def call(Map config = [:]){
232242
}
233243
}
234244
cleanup { // cleanup for outer workspace
235-
script {
236-
if (params.DEBUG) {
237-
echo 'Debug was enabled - MANUALLY CLEAN UP WHEN FINISHED.'
238-
} else {
239-
cleanWs()
240-
// manually remove @tmp dirs
241-
dir("${WORKSPACE}@tmp"){
242-
deleteDir()
243-
}
244-
}
245-
}
245+
buildStages.cleanup()
246246
}
247247
} // End of post
248248
} // End of pipeline

0 commit comments

Comments
 (0)