]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
actually do garbage collection. provide sources.txt with information about the build
authorHolger Levsen <holger@layer-acht.org>
Wed, 17 Oct 2012 09:27:48 +0000 (11:27 +0200)
committerHolger Levsen <holger@layer-acht.org>
Wed, 17 Oct 2012 09:27:48 +0000 (11:27 +0200)
extract_storage_kernel+modules.sh

index 4ee5bf6990f85fd2994c6c100fef3633f33c4cae..82c290985a834e35f2781c855fa7fe53ec4eb03e 100755 (executable)
@@ -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