From 2b84e162d4d8d516ca1389c81e2fc8c24ec2f780 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Mon, 12 Nov 2012 09:44:28 +0100 Subject: add job to check for missing d-i jobs --- bin/d-i_check_jobs.sh | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ job-cfg/d-i.yaml | 49 +++++++++++++++++++++++++++++-------------------- 2 files changed, 80 insertions(+), 20 deletions(-) create mode 100755 bin/d-i_check_jobs.sh diff --git a/bin/d-i_check_jobs.sh b/bin/d-i_check_jobs.sh new file mode 100755 index 00000000..a781912e --- /dev/null +++ b/bin/d-i_check_jobs.sh @@ -0,0 +1,51 @@ +#!/bin/bash + +# Copyright 2012 Holger Levsen +# released under the GPLv=2 + +# +# default settings +# +set -x +set -e +export LC_ALL=C +export http_proxy="http://localhost:3128" + +URL="http://anonscm.debian.org/viewvc/d-i/trunk/.mrconfig?view=co" +FAIL=false +DI_JOBPATTERN=d-i_build_ + +# +# check for missing d-i package build jobs +# for this, we compare referred git repos in .mrconfig against locally existing jenkins jobs +# (see http://wiki.debian.org/DebianInstaller/CheckOut) +# +echo "Scanning $URL for reffered git repos which have no jenkins job associated." +curl $URL 2>/dev/null +for PACKAGE in $( grep git.debian.org/git/d-i $TMPFILE|cut -d "/" -f6-) ; do + # + # check if a jenkins job exist + # + if [ ! -d ~jenkins/jobs/${DI_JOBPATTERN}${PACKAGE} ] ; then + echo "Warning: No build job \'${DI_JOBPATTERN}${PACKAGE}\'." + FAIL=true + else + echo "Ok: Job \'${DI_JOBPATTERN}${PACKAGE}\' exists." + fi +done +echo + +# +# check for missing d-i manual lanague build jobs +# +# FIXME: implement this check ;-) + +# +# fail this job if missing d-i jobs are detected +# +if $FAIL ; then + figlet "Missing jobs!" + exit 1 +else + figlet ok +fi diff --git a/job-cfg/d-i.yaml b/job-cfg/d-i.yaml index fd88870e..9e79f59f 100644 --- a/job-cfg/d-i.yaml +++ b/job-cfg/d-i.yaml @@ -68,7 +68,6 @@ indexfiles: '' keepall: False - - job-template: defaults: d-i name: '{name}_manual' @@ -90,6 +89,34 @@ triggers: - pollscm: "*/30 * * * *" +- job-template: + defaults: d-i + name: '{name}_parse_build_logs' + description: 'Parses d-i build logs daily. {do_not_edit}' + builders: + - shell: '/srv/jenkins/bin/d-i_parse_logs.sh http://d-i.debian.org/daily-images/build-logs.html' + triggers: + - timed: "0 5 * * *" + publishers: + - logparser: + rulespath: '/srv/jenkins/logparse/debian.rules' + unstable_on_warning: 'true' + fail_on_error: 'true' + - htmlpublisher: + name: 'Daily d-i build logs' + directory: '.' + indexfiles: 'build-logs.html' + keepall: True + +- job-template: + defaults: d-i + name: '{name}_check_jenkins_jobs' + description: 'Checks daily for missing jenkins jobs. {do_not_edit}' + builders: + - shell: '/srv/jenkins/bin/d-i_check_jobs.sh' + triggers: + - pollscm: "23 0 * * *" + - job-template: defaults: d-i-manual name: '{name}_manual_ca' @@ -118,25 +145,6 @@ defaults: d-i-manual name: '{name}_manual_pt_BR' -- job-template: - defaults: d-i - name: '{name}_parse_build_logs' - description: 'Parses d-i build logs.{do_not_edit}' - builders: - - shell: '/srv/jenkins/bin/d-i_parse_logs.sh http://d-i.debian.org/daily-images/build-logs.html' - triggers: - - timed: "0 5 * * *" - publishers: - - logparser: - rulespath: '/srv/jenkins/logparse/debian.rules' - unstable_on_warning: 'true' - fail_on_error: 'true' - - htmlpublisher: - name: 'Daily d-i build logs' - directory: '.' - indexfiles: 'build-logs.html' - keepall: True - - project: name: d-i do_not_edit: '

Configured by jenkins-job-builder, do not edit this job through the web UI.' @@ -173,4 +181,5 @@ languagename: 'Brazilian Portuguese' # FIXME: a housekeeping job, ie to check for new languages - '{name}_parse_build_logs' + - '{name}_check_jenkins_jobs' -- cgit v1.2.3-70-g09d2