From 1939f522ae653d0171edc5144df01dc96b374b6a Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Wed, 17 Oct 2012 11:27:48 +0200 Subject: [PATCH] actually do garbage collection. provide sources.txt with information about the build --- extract_storage_kernel+modules.sh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/extract_storage_kernel+modules.sh b/extract_storage_kernel+modules.sh index 4ee5bf6..82c2909 100755 --- a/extract_storage_kernel+modules.sh +++ b/extract_storage_kernel+modules.sh @@ -41,6 +41,12 @@ cp -v /boot/vmlinu* $TARGET_DIR/ cp -v /boot/config* $TARGET_DIR/ cd /lib/modules/*storage/ /bin/tar -cJvf $TARGET_DIR/modules.tar.xz . +echo "Job : $JOBNAME" > $TARGET_DIR/sources.txt +echo "Build-Nr.: $BUILD_NUMBER" >> $TARGET_DIR/sources.txt +echo "URL : http://jenkins/job/$JOB_NAME/$BUILD_NUMBER/" >> $TARGET_DIR/sources.txt +echo >> $TARGET_DIR/sources.txt +apt-cache show profitbricks-linux-image-storage >> $TARGET_DIR/sources.txt +apt-cache show profitbricks-andbd-modules-storage >> $TARGET_DIR/sources.txt EOF chmod +x $BUILD_SCRIPT @@ -50,21 +56,18 @@ chmod +x $BUILD_SCRIPT sudo pbuilder --execute --bindmounts $TARGET_BASE -- $BUILD_SCRIPT rm $BUILD_SCRIPT - -echo "Garbage collection in debug mode..." +set +x +echo "Doing garbage collection now" # -# cleanup $TARGET_DIR, keep as many images as jenkins +# cleanup $TARGET_DIR, keep as many images as jenkins keeps build logs # cd $TARGET_BASE/$TARGET_NAME # loop through all results of current target for i in $(ls -at1) ; do - echo $i # check if the jenkins build log still exists (and doesnt start with ".") # and if not, delete the old target as well if [ ! -L $JOB_HOME/$i ] && [ "${i:0:1}" != "." ] ; then - echo sudo rm -rfv ./$i - else - echo "keeping $i" + sudo rm -r ./$i fi done -- 2.39.5