[Asterisk-code-review] CI: Add optional uninstall step before installing asterisk (asterisk[master])

Jenkins2 asteriskteam at digium.com
Mon Jul 30 09:17:46 CDT 2018


Jenkins2 has submitted this change and it was merged. ( https://gerrit.asterisk.org/9756 )

Change subject: CI: Add optional uninstall step before installing asterisk
......................................................................

CI: Add optional uninstall step before installing asterisk

Change-Id: I7dedf1e925eafc3a0adf01dd9dfbe44eb642aab7
---
M tests/CI/gates.jenkinsfile
M tests/CI/installAsterisk.sh
M tests/CI/periodics-daily.jenkinsfile
M tests/CI/ref_debug.jenkinsfile
M tests/CI/unittests.jenkinsfile
5 files changed, 9 insertions(+), 4 deletions(-)

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



diff --git a/tests/CI/gates.jenkinsfile b/tests/CI/gates.jenkinsfile
index 78a9d24..ab0fd1c 100644
--- a/tests/CI/gates.jenkinsfile
+++ b/tests/CI/gates.jenkinsfile
@@ -153,7 +153,7 @@
 								img.inside("${dockerOptions} --name ${bt}-${groupName}") {
 
 									lock("${JOB_NAME}.${NODE_NAME}.installer") {
-										sh "sudo ./tests/CI/installAsterisk.sh --branch-name=${BRANCH_NAME} --user-group=jenkins:users"
+										sh "sudo ./tests/CI/installAsterisk.sh --uninstall-all --branch-name=${BRANCH_NAME} --user-group=jenkins:users"
 									}
 
 									sh "sudo rm -rf ${groupDir} || : "
diff --git a/tests/CI/installAsterisk.sh b/tests/CI/installAsterisk.sh
index 74f5651..0806566 100755
--- a/tests/CI/installAsterisk.sh
+++ b/tests/CI/installAsterisk.sh
@@ -1,6 +1,8 @@
 #!/usr/bin/env bash
 
 CIDIR=$(dirname $(readlink -fn $0))
+UNINSTALL=0
+UNINSTALL_ALL=0
 source $CIDIR/ci.functions
 
 MAKE=`which make`
@@ -10,6 +12,9 @@
 fi
 destdir=${DESTDIR:+DESTDIR=$DESTDIR}
 
+[ $UNINSTALL -gt 0 ] && ${MAKE} ${destdir} uninstall
+[ $UNINSTALL_ALL -gt 0 ] && ${MAKE} ${destdir} uninstall-all
+
 ${MAKE} ${destdir} install || ${MAKE} ${destdir} NOISY_BUILD=yes install || exit 1
 ${MAKE} ${destdir} samples
 if [ x"$DESTDIR" != x ] ; then
diff --git a/tests/CI/periodics-daily.jenkinsfile b/tests/CI/periodics-daily.jenkinsfile
index 2d72766..8c97379 100644
--- a/tests/CI/periodics-daily.jenkinsfile
+++ b/tests/CI/periodics-daily.jenkinsfile
@@ -99,7 +99,7 @@
 								img.inside("${dockerOptions} --name ${bt}-${groupName}") {
 
 									lock("${JOB_NAME}.${NODE_NAME}.installer") {
-										sh 'sudo ./tests/CI/installAsterisk.sh  --user-group=jenkins:users'
+										sh "sudo ./tests/CI/installAsterisk.sh --uninstall-all --branch-name=${BRANCH_NAME} --user-group=jenkins:users"
 									}
 
 									sh "sudo rm -rf ${groupDir} || : "
diff --git a/tests/CI/ref_debug.jenkinsfile b/tests/CI/ref_debug.jenkinsfile
index d046a49..1fa8688 100644
--- a/tests/CI/ref_debug.jenkinsfile
+++ b/tests/CI/ref_debug.jenkinsfile
@@ -77,7 +77,7 @@
 								img.inside("${dockerOptions} --name ${bt}-${groupName}") {
 
 									lock("${JOB_NAME}.${NODE_NAME}.installer") {
-										sh "sudo ./tests/CI/installAsterisk.sh --branch-name=${BRANCH_NAME}  --user-group=jenkins:users"
+										sh "sudo ./tests/CI/installAsterisk.sh  --uninstall-all --branch-name=${BRANCH_NAME} --user-group=jenkins:users"
 									}
 
 									sh "sudo rm -rf ${groupDir} || : "
diff --git a/tests/CI/unittests.jenkinsfile b/tests/CI/unittests.jenkinsfile
index b019bee..82bafff 100644
--- a/tests/CI/unittests.jenkinsfile
+++ b/tests/CI/unittests.jenkinsfile
@@ -138,7 +138,7 @@
 							def outputfile = "${outputdir}/unittests-results.xml"
 							def testcmd = "test execute all"
 
-							sh "sudo ./tests/CI/installAsterisk.sh --branch-name=${BRANCH_NAME} --user-group=jenkins:users"
+							sh "sudo ./tests/CI/installAsterisk.sh --uninstall-all --branch-name=${BRANCH_NAME} --user-group=jenkins:users"
 
 							sh "tests/CI/runUnittests.sh --user-group=jenkins:users --output-dir='${outputdir}' --output-xml='${outputfile}' --unittest-command='${testcmd}'"
 

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

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I7dedf1e925eafc3a0adf01dd9dfbe44eb642aab7
Gerrit-Change-Number: 9756
Gerrit-PatchSet: 2
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180730/47d52ee2/attachment.html>


More information about the asterisk-code-review mailing list