From 306986cc73af0e95dff3fdfe3f0ad7d488bb74cd Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Mon, 29 Sep 2014 12:34:00 +0200 Subject: reproducible: cleanup pbuilder results and old diffp.logs --- TODO | 5 +---- bin/reproducible_build.sh | 10 ++++++++-- etc/sudoers.d/jenkins | 1 + 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/TODO b/TODO index c34e3f36..29e18e84 100644 --- a/TODO +++ b/TODO @@ -60,6 +60,7 @@ See link:https://jenkins.debian.net/userContent/about.html["about jenkins.debian === d-i_build* +* pbuilder results cleanup * run scripts/digress/ ? * bubulle wrote: "Another interesting target would be d-i builds *including non uploaded packages* (something like "d-i from git repositories" images). That would in some way require to create a quite specific image, with all udebs (while netboot only has udebs needed before one gets a working network setup). * build branches? (which?) @@ -100,11 +101,7 @@ general === reproducible * use git repo in job config? -* investigate packages not in sid from https://jenkins.debian.net/view/reproducible/job/reproducible_build_d-i/lastBuild/console - the list was taken from the jenkins d-i jobs... -* pbuilder results cleanup * pbuilder cleanup cache -* cleanup userContent/diffp/ -** graph number of reproducible packages === Test Debian live diff --git a/bin/reproducible_build.sh b/bin/reproducible_build.sh index 4290ae38..072ae10e 100755 --- a/bin/reproducible_build.sh +++ b/bin/reproducible_build.sh @@ -15,6 +15,10 @@ else git clone git://git.debian.org/git/reproducible/misc.git misc.git fi +# create dirs for results +mkdir -p results/_success +mkdir -p /var/lib/jenkins/userContent/diffp/ + # create sqlite db PACKAGES_DB=/var/lib/jenkins/reproducible.db if [ ! -f $PACKAGES_DB ] ; then @@ -114,13 +118,12 @@ for SRCPACKAGE in $PACKAGES ; do sudo dcmd rm /var/cache/pbuilder/result/${SRCPACKAGE}_*.changes set -e cat b1/${SRCPACKAGE}_*.changes - mkdir -p results/_success - mkdir -p /var/lib/jenkins/userContent/diffp/ LOGFILE=$(ls ${SRCPACKAGE}_*.dsc) LOGFILE=$(echo ${LOGFILE%.dsc}.diffp.log) ./misc.git/diffp b1/${SRCPACKAGE}_*.changes b2/${SRCPACKAGE}_*.changes | tee ./results/${LOGFILE} if ! $(grep -qv '^\*\*\*\*\*' ./results/${LOGFILE}) ; then mv ./results/${LOGFILE} ./results/_success/ + rm -f /var/lib/jenkins/userContent/diffp/${SRCPACKAGE}_*.diffp.log > /dev/null 2>&1 figlet ${SRCPACKAGE} echo echo "${SRCPACKAGE} built successfully and reproducibly." @@ -129,6 +132,7 @@ for SRCPACKAGE in $PACKAGES ; do GOOD="${SRCPACKAGE} ${GOOD}" touch results/___.dummy.log # not having any bad logs is not a reason for failure else + rm -f /var/lib/jenkins/userContent/diffp/${SRCPACKAGE}_*.diffp.log > /dev/null 2>&1 cp ./results/${LOGFILE} /var/lib/jenkins/userContent/diffp/ echo "Warning: ${SRCPACKAGE} failed to build reproducibly." sqlite3 -init $INIT $PACKAGES_DB "REPLACE INTO source_packages VALUES (\"${SRCPACKAGE}\", \"${VERSION}\", \"unreproducible\", \"$DATE\", \"\")" @@ -142,6 +146,8 @@ for SRCPACKAGE in $PACKAGES ; do fi dcmd rm ${SRCPACKAGE}_*.dsc + sudo rm -f /var/cache/pbuilder/result/${SRCPACKAGE}_* + fi set +x diff --git a/etc/sudoers.d/jenkins b/etc/sudoers.d/jenkins index 5acc194b..f3250a0e 100644 --- a/etc/sudoers.d/jenkins +++ b/etc/sudoers.d/jenkins @@ -28,6 +28,7 @@ jenkins ALL= \ /bin/chown -R jenkins\:jenkins /var/lib/jenkins/jobs/*,\ SETENV: NOPASSWD: /usr/sbin/pbuilder *, \ /bin/rm /var/cache/pbuilder/base*.tgz, \ + /bin/rm -f /var/cache/pbuilder/results/*, \ /usr/bin/dcmd rm *.changes, \ /usr/bin/apt-get update -- cgit v1.2.3-70-g09d2