Skip to content

Commit ac2311b

Browse files
Sbachmei/mic 5593/bugfix clean jenkins workspace (#121)
1 parent acc736a commit ac2311b

File tree

3 files changed

+21
-6
lines changed

3 files changed

+21
-6
lines changed

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<!-- For use in commit message, wrap at 72 chars. 72 chars is here: -->
66
- *Category*: <!-- one of bugfix, feature, refactor, POC, CI/infrastructure, documentation,
77
revert, test, release, other/misc -->
8-
- *JIRA issue*: [MIC-XYZ](https://jira.ihme.washington.edu/browse/MIC-XYZ)
8+
- *JIRA issue*: https://jira.ihme.washington.edu/browse/MIC-XYZ
99

1010
### Changes and notes
1111
<!--

CHANGELOG.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
**4.1.1 - 12/2/24**
2+
3+
- Properly clean up Jenkins workspaces
4+
15
**4.1.0 - 11/06/24**
26

37
- Drop support for Python 3.9

Jenkinsfile

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,6 @@ pipeline {
203203
} // stages bracket within Python matrix
204204
post {
205205
always {
206-
sh "${ACTIVATE} && make clean"
207-
sh "rm -rf ${CONDA_ENV_PATH}"
208206
// Generate a message to send to Slack.
209207
script {
210208
if (env.BRANCH == "main") {
@@ -226,9 +224,6 @@ pipeline {
226224
Build details: <${env.BUILD_URL}/console|See in web console>
227225
""".stripIndent()
228226
}
229-
230-
// Delete the workspace directory.
231-
deleteDir()
232227
}
233228
failure {
234229
echo "This build triggered by ${developerID} failed on ${GIT_BRANCH}. Sending a failure message to Slack."
@@ -250,8 +245,24 @@ pipeline {
250245
}
251246
}
252247
}
248+
cleanup { // cleanup for python matrix workspaces
249+
sh "${ACTIVATE} && make clean"
250+
sh "rm -rf ${CONDA_ENV_PATH}"
251+
cleanWs()
252+
dir("${WORKSPACE}@tmp"){
253+
deleteDir()
254+
}
255+
}
253256
} // post bracket
254257
} // Python matrix bracket
255258
} // Python matrix stage bracket
256259
} // stages bracket
260+
post {
261+
cleanup { // cleanup for outer workspace
262+
cleanWs()
263+
dir("${WORKSPACE}@tmp"){
264+
deleteDir()
265+
}
266+
}
267+
}
257268
}

0 commit comments

Comments
 (0)