[Asterisk-code-review] CI: Increase clone depth and do better cleanup (testsuite[master])

George Joseph asteriskteam at digium.com
Tue Nov 19 12:18:25 CST 2019


George Joseph has submitted this change. ( https://gerrit.asterisk.org/c/testsuite/+/13258 )

Change subject: CI: Increase clone depth and do better cleanup
......................................................................

CI: Increase clone depth and do better cleanup

The original clone depth of 10 was causing the need to rebase
changes whose parent was older than the 10 commits.  The clone
depth has been increased to 100.

Workspace cleanup was only happening for successful builds which
wasn't enough to keep the 8G workspace in-memory drives on the
docker slaves from filling up.  Now the workspaces are cleaned up
after every build regardless of success/failure.  If you need to
preserve builds temporarily, you can log into Jenkins/Manage
Jenkins/Configure System and change the CLEANUP_WS_* environment
variable for the job type you're troubleshooting to "FALSE".

Change-Id: I8e7dc1eab8c132c0315dfecd8395a8ffa2a2e3d2
(cherry picked from commit d4753f771d0440e6be9b1440a563584a7d9d83f2)
(cherry picked from commit 77d7bb0b625945cac38f821f37cf1b5402ee9afa)
(cherry picked from commit c547cce6cfd958e17da58796552a388b272edaa7)
---
M CI/gates.jenkinsfile
M CI/unittests.jenkinsfile
2 files changed, 14 insertions(+), 8 deletions(-)

Approvals:
  George Joseph: Looks good to me, approved; Approved for Submit



diff --git a/CI/gates.jenkinsfile b/CI/gates.jenkinsfile
index 309bed6..3441c00 100644
--- a/CI/gates.jenkinsfile
+++ b/CI/gates.jenkinsfile
@@ -107,7 +107,7 @@
 								[$class: 'CloneOption',
 									honorRefspec: true,
 									noTags: true,
-									depth: 10,
+									depth: 100,
 									shallow: true
 								],
 								[$class: 'PruneStaleBranch'],
@@ -146,7 +146,7 @@
 								[$class: 'RelativeTargetDirectory', relativeTargetDir: astDir],
 								[$class: 'CloneOption',
 									noTags: true,
-									depth: 10,
+									depth: 100,
 									honorRefspec: true,
 									shallow: true
 								],
@@ -173,8 +173,11 @@
 	}
 	post {
 		cleanup {
-			sh "sudo make distclean 2&>/dev/null || : "
-			sh "sudo rm -rf CI/output 2&>/dev/null || : "
+			script {
+				if (env.CLEANUP_WS_GATES.toBoolean()) {
+					cleanWs deleteDirs: true, notFailBuild: false
+				}
+			}
 		}
 		/*
 		 * The Gerrit Trigger will automatically post the "Verified" results back
diff --git a/CI/unittests.jenkinsfile b/CI/unittests.jenkinsfile
index 8eb2615..0312c24 100644
--- a/CI/unittests.jenkinsfile
+++ b/CI/unittests.jenkinsfile
@@ -109,7 +109,7 @@
 								[$class: 'CloneOption',
 									honorRefspec: true,
 									noTags: true,
-									depth: 10,
+									depth: 100,
 									shallow: true
 								],
 								[$class: 'PruneStaleBranch'],
@@ -148,7 +148,7 @@
 								[$class: 'RelativeTargetDirectory', relativeTargetDir: astDir],
 								[$class: 'CloneOption',
 									noTags: true,
-									depth: 10,
+									depth: 100,
 									honorRefspec: true,
 									shallow: true
 								],
@@ -175,8 +175,11 @@
 	}
 	post {
 		cleanup {
-			sh "sudo make distclean 2&>/dev/null || : "
-			sh "sudo rm -rf CI/output 2&>/dev/null || : "
+			script {
+				if (env.CLEANUP_WS_UNITTESTS.toBoolean()) {
+					cleanWs deleteDirs: true, notFailBuild: false
+				}
+			}
 		}
 		/*
 		 * The Gerrit Trigger will automatically post the "Verified" results back

-- 
To view, visit https://gerrit.asterisk.org/c/testsuite/+/13258
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Change-Id: I8e7dc1eab8c132c0315dfecd8395a8ffa2a2e3d2
Gerrit-Change-Number: 13258
Gerrit-PatchSet: 2
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20191119/dc1c4221/attachment-0001.html>


More information about the asterisk-code-review mailing list