CI: cleanup workspace after successfull build
...to save disk space.
--- a/ci/build.groovy Tue Jun 23 12:16:02 2020 +0100
+++ b/ci/build.groovy Tue Jun 23 12:21:39 2020 +0100
@@ -53,3 +53,4 @@
* ...and fire the pipeline
*/
steps.build()
+steps.cleanup()
\ No newline at end of file
--- a/ci/integrate.groovy Tue Jun 23 12:16:02 2020 +0100
+++ b/ci/integrate.groovy Tue Jun 23 12:21:39 2020 +0100
@@ -50,6 +50,7 @@
steps.branch = branch()
/*
- * ...and fire the pipeline
+ * ...and fire the pipeline
*/
steps.integration()
+steps.cleanup()
\ No newline at end of file
--- a/ci/steps.groovy Tue Jun 23 12:16:02 2020 +0100
+++ b/ci/steps.groovy Tue Jun 23 12:21:39 2020 +0100
@@ -282,6 +282,17 @@
}
}
+/**
+ * Cleanup the workspace
+ */
+ def cleanup() {
+ matrix ( configurations ) {
+ stage ( "Cleanup - {${env.BUILD_TARGET}}") {
+ cleanWs cleanWhenAborted: false, cleanWhenFailure: false, cleanWhenNotBuilt: false, cleanWhenUnstable: false
+ }
+ }
+ }
+
/*
* Utility. Executes given block with credentials for upstream repository.
*/