]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
Add script name to temporary files.
authorBenjamin Drung <benjamin.drung@profitbricks.com>
Wed, 15 Jan 2014 10:01:58 +0000 (11:01 +0100)
committerBenjamin Drung <benjamin.drung@profitbricks.com>
Wed, 15 Jan 2014 10:01:58 +0000 (11:01 +0100)
This allows to track down left-over temporary files to their sources.

extract_storage_kernel+modules.sh
liveboot-dbg-tar/create_debug_archive.sh
liveboot_build.sh
liveboot_gw_autotest.sh
liveboot_pserver1301_deploy.sh
liveboot_pserver_reset.sh
liveboot_set_test_state.sh
puppet_lint_run.sh
pxe_install.sh
pxe_riserver_setup.sh

index 3696aa9c914d8eb03369b58b60dca3deab0cd260..b77494df5378792281591dcd9c6c46cf279de4f5 100755 (executable)
@@ -76,7 +76,7 @@ export TARGET_DIR=$TARGET_BASE/$TARGET_NAME/$BUILD_NUMBER
 export JOB_HOME=$JENKINS_HOME/jobs/$JOB_NAME/builds
 
 SCRIPTSDIR=$(dirname $0)
-BUILD_SCRIPT=$(mktemp)
+BUILD_SCRIPT=$(mktemp -t ${0##*/}.XXXXXXXXXX)
 cat > $BUILD_SCRIPT <<-EOF
 #/bin/bash
 set -e
index 64cb22e26ae7e0eb4848ad3bf4b01e93903684a5..671377aa2b676d426e9aa0d50ca436d0fa462880 100755 (executable)
@@ -3,7 +3,7 @@
 set -eux
 
 script_dir="$( cd "$( dirname "$0" )" && pwd )"
-workdir="$(mktemp -d)"
+workdir="$(mktemp -d -t ${0##*/}.XXXXXXXXXX)"
 liveboot_id="$LIVEBOOT_BUILD_NUMBER"
 assembledir="$workdir/liveboot-$liveboot_id-kernel-dbg"
 
index 871a7f27e7356440b5fe04a743fa5fa94bea678b..02bc3b2f607b5bc1d85fdcf405e07c572a4b4db6 100755 (executable)
@@ -32,7 +32,7 @@ export DIST=squeeze
 export PB_SUITE=production-proposed-updates
 
 SCRIPTSDIR=$(dirname $0)
-BUILD_SCRIPT=$(mktemp)
+BUILD_SCRIPT=$(mktemp -t ${0##*/}.XXXXXXXXXX)
 cat > $BUILD_SCRIPT <<-EOF
 cd /srv/build
 rm liveboot -rf
index 1aeacdbc64384eaa0ce79cba68b542d24f512a85..5f8159dd80e7ce5d54b55d4d44464d0f77ee9da2 100755 (executable)
@@ -22,7 +22,7 @@ echo "AUTOTEST_CONFIG: ${AUTOTEST_CONFIG}"
 #
 # prepare ssh
 #
-TMPFILE=$(mktemp)
+TMPFILE=$(mktemp -t ${0##*/}.XXXXXXXXXX)
 ssh-agent > $TMPFILE
 source $TMPFILE
 ssh-add ~/.ssh/id_ritest
index 36847fe0968ccc114c5b34545f78d0922ff03cdc..966f58ec7af4d7b8f40ed6b57f03928fad18550f 100755 (executable)
@@ -114,7 +114,7 @@ echo
 #
 # add jenkins user and sudoers.d/jenkins for it
 #
-TMPFILE=$(mktemp)
+TMPFILE=$(mktemp -t ${0##*/}.XXXXXXXXXX)
 cat > $TMPFILE <<-EOF
 addgroup --system jenkins
 adduser --system --home /home/jenkins --shell /bin/bash --ingroup jenkins --disabled-password --gecos "Profitbricks jenkins user" jenkins
index 3789b0db169399b03ee0bf6e1ff943895f82d4d0..7da7b149b608680e62990bb1a29b9c72187a1e67 100755 (executable)
@@ -72,7 +72,7 @@ echo
 #
 # add jenkins user and sudoers.d/jenkins for it
 #
-TMPFILE=$(mktemp)
+TMPFILE=$(mktemp -t ${0##*/}.XXXXXXXXXX)
 cat > $TMPFILE <<-EOF
 addgroup --system jenkins
 adduser --system --home /home/jenkins --shell /bin/bash --ingroup jenkins --disabled-password --gecos "Profitbricks jenkins user" jenkins
index 7d25cef04b970af3a157640852157d04dce123ad..a0d793dfee0b0c2fc3d7e7ea41aced1b16963ecc 100755 (executable)
@@ -21,7 +21,7 @@ then
 fi
 
 # Checkout liveboot repo
-BUILD_SCRIPT=$(mktemp)
+BUILD_SCRIPT=$(mktemp -t ${0##*/}.XXXXXXXXXX)
 cat > $BUILD_SCRIPT <<-EOF
 cd /srv/build
 rm /srv/build/liveboot_test_state -rf
index 141442e351c95f2cf05d5b49009943ecdb61bbf0..d977ce946056eaa9f1d5130a0dd53f24f0ea6cff 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/bash
 # copyright 2012 Holger Levsen GPL2 licenced, holger@layer-acht.org
 
-OUTPUT=$(mktemp)
+OUTPUT=$(mktemp -t ${0##*/}.XXXXXXXXXX)
 
 for file in $(find . -iname '*.pp') ; do
        echo -n "parsing $file: "
index 239f08dd7fe043fc4fc3b77671397b561b23788a..db66033d040a714ecf9f3daa653cf38045a0eb7a 100755 (executable)
@@ -72,7 +72,7 @@ echo "successfully installed"
 #
 # prepare ssh
 #
-TMPFILE=$(mktemp)
+TMPFILE=$(mktemp -t ${0##*/}.XXXXXXXXXX)
 ssh-agent > $TMPFILE
 source $TMPFILE
 ssh-add ~/.ssh/id_ritest
index d07f2c21aa6cb5ab1b4bb71597cc563ea981d957..340768ec1f8521af50d7ae58a2d6bda628e480d1 100755 (executable)
@@ -28,7 +28,7 @@ echo
 echo
 echo
 
-TMPFILE=$(mktemp)
+TMPFILE=$(mktemp -t ${0##*/}.XXXXXXXXXX)
 cat > $TMPFILE <<-EOF
 # Generated automatically by jenkins - don't edit manually, it will be overwritten
 TIMEOUT 100