CI: Add optional uninstall step before installing asterisk
authorGeorge Joseph <gjoseph@digium.com>
Fri, 27 Jul 2018 18:23:02 +0000 (12:23 -0600)
committerGeorge Joseph <gjoseph@digium.com>
Mon, 30 Jul 2018 13:44:05 +0000 (07:44 -0600)
Change-Id: I7dedf1e925eafc3a0adf01dd9dfbe44eb642aab7

tests/CI/gates.jenkinsfile
tests/CI/installAsterisk.sh
tests/CI/periodics-daily.jenkinsfile
tests/CI/ref_debug.jenkinsfile
tests/CI/unittests.jenkinsfile

index 78a9d24..ab0fd1c 100644 (file)
@@ -153,7 +153,7 @@ pipeline {
                                                                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} || : "
index 74f5651..0806566 100755 (executable)
@@ -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 @@ if [ x"$DESTDIR" != x ] ; then
 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
index 2d72766..8c97379 100644 (file)
@@ -99,7 +99,7 @@ pipeline {
                                                                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} || : "
index d046a49..1fa8688 100644 (file)
@@ -77,7 +77,7 @@ pipeline {
                                                                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} || : "
index b019bee..82bafff 100644 (file)
@@ -138,7 +138,7 @@ pipeline {
                                                        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}'"