There was an error while loading. Please reload this page.
1 parent 638d011 commit 504afa4Copy full SHA for 504afa4
1 file changed
.jenkins.groovy
@@ -201,6 +201,20 @@ Check console output at "<a href="${env.BUILD_URL}">${env.JOB_NAME} [${env.BRANC
201
// Cleanup the build directory if the build was successful
202
// (in this case we probably don't have to do any post-build analysis)
203
cleanBeforeCheckout()
204
+ stage('Prune old workspaces') {
205
+ when {
206
+ expression { MATRIX_JDK == latestSupportedJDK }
207
+ }
208
+ steps {
209
+ sh '''
210
+ set -eu
211
+ base_dir="workspace/${JOB_NAME}/MatrixCheckout"
212
+ if [ -d "$base_dir" ]; then
213
+ find "$base_dir" -mindepth 1 -maxdepth 1 -type d -mtime +30 -exec rm -rf {} +
214
+ fi
215
+ '''
216
217
218
script {
219
if (deployableBranch
220
&& (currentBuild.previousBuild != null) && (currentBuild.previousBuild.result != 'SUCCESS')) {
0 commit comments