Skip to content

Commit

Permalink
Sbachmei/mic 5593/bugfix clean jenkins workspace (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevebachmeier authored Dec 2, 2024
1 parent acc736a commit ac2311b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<!-- For use in commit message, wrap at 72 chars. 72 chars is here: -->
- *Category*: <!-- one of bugfix, feature, refactor, POC, CI/infrastructure, documentation,
revert, test, release, other/misc -->
- *JIRA issue*: [MIC-XYZ](https://jira.ihme.washington.edu/browse/MIC-XYZ)
- *JIRA issue*: https://jira.ihme.washington.edu/browse/MIC-XYZ

### Changes and notes
<!--
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
**4.1.1 - 12/2/24**

- Properly clean up Jenkins workspaces

**4.1.0 - 11/06/24**

- Drop support for Python 3.9
Expand Down
21 changes: 16 additions & 5 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,6 @@ pipeline {
} // stages bracket within Python matrix
post {
always {
sh "${ACTIVATE} && make clean"
sh "rm -rf ${CONDA_ENV_PATH}"
// Generate a message to send to Slack.
script {
if (env.BRANCH == "main") {
Expand All @@ -226,9 +224,6 @@ pipeline {
Build details: <${env.BUILD_URL}/console|See in web console>
""".stripIndent()
}

// Delete the workspace directory.
deleteDir()
}
failure {
echo "This build triggered by ${developerID} failed on ${GIT_BRANCH}. Sending a failure message to Slack."
Expand All @@ -250,8 +245,24 @@ pipeline {
}
}
}
cleanup { // cleanup for python matrix workspaces
sh "${ACTIVATE} && make clean"
sh "rm -rf ${CONDA_ENV_PATH}"
cleanWs()
dir("${WORKSPACE}@tmp"){
deleteDir()
}
}
} // post bracket
} // Python matrix bracket
} // Python matrix stage bracket
} // stages bracket
post {
cleanup { // cleanup for outer workspace
cleanWs()
dir("${WORKSPACE}@tmp"){
deleteDir()
}
}
}
}

0 comments on commit ac2311b

Please sign in to comment.