Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sbachmei/mic 5593/bugfix clean jenkins workspace #121

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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()
}
}
}
}
Loading