Skip to content

Commit

Permalink
CI: Add optional uninstall step before installing asterisk
Browse files Browse the repository at this point in the history
Change-Id: I7dedf1e925eafc3a0adf01dd9dfbe44eb642aab7
  • Loading branch information
gtjoseph committed Jul 30, 2018
1 parent 59f5351 commit 914b9e1
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tests/CI/gates.jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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} || : "
Expand Down
5 changes: 5 additions & 0 deletions tests/CI/installAsterisk.sh
Original file line number Diff line number Diff line change
@@ -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`
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/CI/periodics-daily.jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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} || : "
Expand Down
2 changes: 1 addition & 1 deletion tests/CI/ref_debug.jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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} || : "
Expand Down
2 changes: 1 addition & 1 deletion tests/CI/unittests.jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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}'"

Expand Down

0 comments on commit 914b9e1

Please sign in to comment.