diff options
author | Holger Levsen <holger@layer-acht.org> | 2017-04-26 12:59:41 +0200 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2017-04-26 12:59:41 +0200 |
commit | 1129233bbbefdfa083c76f0e386d8be04100ca08 (patch) | |
tree | cb9da10b65052199760d4a8a2978af964f316489 | |
parent | 8634f957113ab2596e58bf8c4c2a3708b74dd6a5 (diff) | |
download | jenkins.debian.net-1129233bbbefdfa083c76f0e386d8be04100ca08.tar.xz |
reproducible Debian: let maintenance job cleanup old build service logfiles
Signed-off-by: Holger Levsen <holger@layer-acht.org>
-rwxr-xr-x | bin/reproducible_build_service.sh | 7 | ||||
-rwxr-xr-x | bin/reproducible_maintenance.sh | 21 |
2 files changed, 14 insertions, 14 deletions
diff --git a/bin/reproducible_build_service.sh b/bin/reproducible_build_service.sh index 0519b680..d2a78403 100755 --- a/bin/reproducible_build_service.sh +++ b/bin/reproducible_build_service.sh @@ -60,10 +60,9 @@ done while true ; do sleep 23m ; done # TODO left: -# * maintenance job needs to: -# - cleanup the log files eventually -# - check for running builds using systemctl show +# * translate yaml into a script or such to create those service files (done for i386 for now) # * logs should auto display in browser like with jenkins… (long-polling, meta-refresh, something) # - there's an NPH solution pointed out by Xtaran -# * translate yaml into a script or such to create those service files (done for i386 for now) +# * maintenance job might want to: +# - check for running builds using systemctl show diff --git a/bin/reproducible_maintenance.sh b/bin/reproducible_maintenance.sh index 066f968c..a88c2afe 100755 --- a/bin/reproducible_maintenance.sh +++ b/bin/reproducible_maintenance.sh @@ -207,16 +207,17 @@ if [ -d /srv/workspace/pbuilder/ ] ; then fi # delete build services logfiles -if [ -d /var/lib/jenkins/userContent/reproducible/debian/build_service/ ] ; then - echo "$(date -u) - Deleting pbuilder build directories, older than 3 days." - OLDSTUFF=$(find /var/lib/jenkins/userContent/reproducible/debian/build_service/ -maxdepth 2 -regex '.*/[0-9]+' -type d -mtime +2 -exec ls -lad {} \; || true) - if [ ! -z "$OLDSTUFF" ] ; then - echo - echo "Old pbuilder build directories found in /var/lib/jenkins/userContent/reproducible/debian/build_service/" - echo -n "$OLDSTUFF" - find /var/lib/jenkins/userContent/reproducible/debian/build_service/ -maxdepth 2 -regex '.*/[0-9]+' -type d -mtime +2 -exec sudo rm -rf --one-file-system {} \; || true - echo - DIRTY=true +if [ "$HOSTNAME" = "$MAINNODE" ] ; then + if [ -d /var/lib/jenkins/userContent/reproducible/debian/build_service/ ] ; then + echo "$(date -u) - Deleting logfiles from build services directories, older than 3 days." + OLDSTUFF=$(find /var/lib/jenkins/userContent/reproducible/debian/build_service/ -maxdepth 2 -regex '.*/[0-9]+' -type d -mtime +2 -exec ls -lad {} \; || true) + if [ ! -z "$OLDSTUFF" ] ; then + echo + echo "Old logfiles cleaned in /var/lib/jenkins/userContent/reproducible/debian/build_service/" + echo -n "$OLDSTUFF" + find /var/lib/jenkins/userContent/reproducible/debian/build_service/ -maxdepth 2 -regex '.*/[0-9]+' -type d -mtime +2 -exec sudo rm -rf --one-file-system {} \; || true + echo + fi fi fi |