summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2012-12-16 16:29:18 +0100
committerHolger Levsen <holger@layer-acht.org>2012-12-16 16:29:18 +0100
commitcdfa8a5d20065d3e0fb80cd27e251220296da654 (patch)
tree10de2e64745191c995b0e1420dfd13e7253ec84f
parent28fc6b0d82d24eb6bc3ebc65274786b7b7e3d3ce (diff)
downloadjenkins.debian.net-cdfa8a5d20065d3e0fb80cd27e251220296da654.tar.xz
new job: self_sub-housekeeping-squid
-rwxr-xr-xbin/housekeeping.sh19
-rw-r--r--job-cfg/self.yaml12
2 files changed, 22 insertions, 9 deletions
diff --git a/bin/housekeeping.sh b/bin/housekeeping.sh
index 2efa7b8b..08a14f85 100755
--- a/bin/housekeeping.sh
+++ b/bin/housekeeping.sh
@@ -32,12 +32,17 @@ report_disk_usage() {
}
report_filetype_usage() {
- find ${1}_* -type f -name "*.${2}"|xargs du -sch |grep total |sed -s "s#total#$1 .$2 files#"
+ find /var/lib/jenkins/jobs/${1}_* -type f -name "*.${2}" 2>/dev/null|xargs -r du -sch |grep total |sed -s "s#total#$1 .$2 files#"
}
report_squid_usage() {
- cat /var/www/calamaris/calamaris.txt
+ REPORT=/var/www/calamaris/calamaris.txt
+ if [ -z $1 ] ; then
+ cat $REPORT
+ else
+ head -31 $REPORT
+ fi
}
general_housekeeping() {
@@ -67,16 +72,18 @@ general_housekeeping() {
#
if [ -z $1 ] ; then
general_housekeeping
- report_squid_usage
+ report_squid_usage brief
else
- report_disk_usage $1
case $1 in
- chroot-installation) check_for_mounted_chroots $1
+ chroot-installation) report_disk_usage $1
+ check_for_mounted_chroots $1
;;
- g-i-installation) report_filetype_usage $1 raw
+ g-i-installation) report_disk_usage $1
+ report_filetype_usage $1 raw
report_filetype_usage $1 iso
report_filetype_usage $1 png
;;
+ squid) report_squid_usage
*) ;;
esac
fi
diff --git a/job-cfg/self.yaml b/job-cfg/self.yaml
index d300ed1b..220ae5ab 100644
--- a/job-cfg/self.yaml
+++ b/job-cfg/self.yaml
@@ -9,7 +9,7 @@
triggers:
- timed: "30 6 * * *"
builders:
- - shell: '/srv/jenkins/bin/housekeeping.sh'
+ - shell: '{my_shell}'
publishers:
- logparser:
rulespath: '/srv/jenkins/logparse/debian.rules'
@@ -31,14 +31,20 @@
text: Sponsored by Profitbricks
icon: /userContent/images/profitbricks-24x24.png
-
- job-template:
defaults: self-housekeeping
name: '{name}_housekeeping'
+- job-template:
+ defaults: self-housekeeping
+ name: '{name}_sub-housekeeping-squid'
+
- project:
name: self
do_not_edit: '<br><br>Job configuration source is <a href="http://anonscm.debian.org/gitweb/?p=users/holger/jenkins.debian.net.git;a=blob;f=job-cfg/self.yaml">self.yaml</a>.'
jobs:
- - '{name}_housekeeping'
+ - '{name}_housekeeping':
+ my_shell: '/srv/jenkins/bin/housekeeping.sh'
+ - '{name}_sub-housekeeping-squid':
+ my_shell: '/srv/jenkins/bin/housekeeping.sh squid'