[Qa-jenkins-scm] [jenkins.debian.net] 01/01: reproducible Debian: let maintenance job cleanup old build service logfiles
Holger Levsen
holger at layer-acht.org
Wed Apr 26 10:59:50 UTC 2017
This is an automated email from the git hooks/post-receive script.
holger pushed a commit to branch master
in repository jenkins.debian.net.
commit 1129233bbbefdfa083c76f0e386d8be04100ca08
Author: Holger Levsen <holger at layer-acht.org>
Date: Wed Apr 26 12:59:41 2017 +0200
reproducible Debian: let maintenance job cleanup old build service logfiles
Signed-off-by: Holger Levsen <holger at layer-acht.org>
---
bin/reproducible_build_service.sh | 7 +++----
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 0519b68..d2a7840 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 066f968..a88c2af 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
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/qa/jenkins.debian.net.git
More information about the Qa-jenkins-scm
mailing list