From: Holger Levsen Date: Thu, 25 Oct 2012 14:50:15 +0000 (+0200) Subject: finally, trap sudo X-Git-Url: https://git.uhu-banane.de/?a=commitdiff_plain;h=8e56a9cb7ac466f1aa319bd5d82d550f825707b0;p=profitbricks%2Fjenkins-build-scripts.git finally, trap sudo --- diff --git a/liveboot_build.sh b/liveboot_build.sh index 9babfee..66b87bb 100755 --- a/liveboot_build.sh +++ b/liveboot_build.sh @@ -9,6 +9,7 @@ set_failure() { exit 1 } +set -x export if [ "$REQUEST_ID" = "" ] ; then @@ -48,9 +49,11 @@ trap set_failure INT TERM EXIT ERR KILL STOP HUP ABRT # # build liveboot -# -sudo pbuilder --execute --bindmounts /srv/build/ -- $BUILD_SCRIPT -rm $BUILD_SCRIPT +# (sudo is called from within a(nother) script as it's not possible to trap sudo directly +# +echo "sudo pbuilder --execute --bindmounts /srv/build/ -- $BUILD_SCRIPT" > ${BUILD_SCRIPT}_sudo +bash -x ${BUILD_SCRIPT}_sudo +rm $BUILD_SCRIPT ${BUILD_SCRIPT}_sudo # # add liveboot build result to cidb