summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2012-11-21 23:49:03 +0100
committerHolger Levsen <holger@layer-acht.org>2012-11-21 23:49:03 +0100
commite610b7c5b9729886a51cb8e11c7a80d42269a8c9 (patch)
treea2eaa72dc8bc2fbcc3027e895e42c90fc430ce75
parentbb86b6e66de018befac6bc56de982810e8a0b83e (diff)
downloadjenkins.debian.net-e610b7c5b9729886a51cb8e11c7a80d42269a8c9.tar.xz
use for loop
-rwxr-xr-xbin/d-i_check_jobs.sh96
1 files changed, 30 insertions, 66 deletions
diff --git a/bin/d-i_check_jobs.sh b/bin/d-i_check_jobs.sh
index 0d96f4cd..23e166bc 100755
--- a/bin/d-i_check_jobs.sh
+++ b/bin/d-i_check_jobs.sh
@@ -76,39 +76,21 @@ for DIRECTORY in * ; do
if [ "$DIRECTORY" == "" ] ; then
continue
else
- # FIXME: turn this into a loop: pdf html
- #
- # html build job
- #
- if [ ! -d ~jenkins/jobs/${DI_MANUAL_JOB_PATTERN}${DIRECTORY}_html ] ; then
- echo "Warning: No build job '${DI_MANUAL_JOB_PATTERN}${DIRECTORY}_html'."
- FAIL=true
- #
- # prepare yaml bits
- #
- echo " - '{name}_manual_${DIRECTORY}_html':" >> $PROJECT_JOBS
- echo " lang: '$DIRECTORY'" >> $PROJECT_JOBS
- echo " languagename: 'FIXME: $DIRECTORY'" >> $PROJECT_JOBS
- echo "- job-template:" >> $JOB_TEMPLATES
- echo " defaults: d-i-manual-html" >> $JOB_TEMPLATES
- echo " name: '{name}_manual_${DIRECTORY}_html'" >> $JOB_TEMPLATES
- fi
- #
- # pdf build job
- #
- if [ ! -d ~jenkins/jobs/${DI_MANUAL_JOB_PATTERN}${DIRECTORY}_pdf ] ; then
- echo "Warning: No build job '${DI_MANUAL_JOB_PATTERN}${DIRECTORY}_pdf'."
- FAIL=true
- #
- # prepare yaml bits
- #
- echo " - '{name}_manual_${DIRECTORY}_pdf':" >> $PROJECT_JOBS
- echo " lang: '$DIRECTORY'" >> $PROJECT_JOBS
- echo " languagename: 'FIXME: $DIRECTORY'" >> $PROJECT_JOBS
- echo "- job-template:" >> $JOB_TEMPLATES
- echo " defaults: d-i-manual-pdf" >> $JOB_TEMPLATES
- echo " name: '{name}_manual_${DIRECTORY}_pdf'" >> $JOB_TEMPLATES
- fi
+ for FORMAT in "pdf html" ; do
+ if [ ! -d ~jenkins/jobs/${DI_MANUAL_JOB_PATTERN}${DIRECTORY}_${FORMAT} ] ; then
+ echo "Warning: No build job '${DI_MANUAL_JOB_PATTERN}${DIRECTORY}_${FORMAT}'."
+ FAIL=true
+ #
+ # prepare yaml bits
+ #
+ echo " - '{name}_manual_${DIRECTORY}_${FORMAT}':" >> $PROJECT_JOBS
+ echo " lang: '$DIRECTORY'" >> $PROJECT_JOBS
+ echo " languagename: 'FIXME: $DIRECTORY'" >> $PROJECT_JOBS
+ echo "- job-template:" >> $JOB_TEMPLATES
+ echo " defaults: d-i-manual-${FORMAT}" >> $JOB_TEMPLATES
+ echo " name: '{name}_manual_${DIRECTORY}_${FORMAT}'" >> $JOB_TEMPLATES
+ fi
+ done
fi
done
# FIXME: check for removed manuals (but with existing jobs) missing
@@ -126,39 +108,21 @@ for DIRECTORY in * ; do
if [ "$DIRECTORY" == "" ] ; then
continue
else
- # FIXME: turn this into a loop: pdf html
- #
- # html build job
- #
- if [ ! -d ~jenkins/jobs/${DI_MANUAL_JOB_PATTERN}${DIRECTORY}_html_po2xml ] ; then
- echo "Warning: No build job '${DI_MANUAL_JOB_PATTERN}${DIRECTORY}_html_po2xml'."
- FAIL=true
- #
- # prepare yaml bits
- #
- echo " - '{name}_manual_${DIRECTORY}_html':" >> $PROJECT_JOBS
- echo " lang: '$DIRECTORY'" >> $PROJECT_JOBS
- echo " languagename: 'FIXME: $DIRECTORY'" >> $PROJECT_JOBS
- echo "- job-template:" >> $JOB_TEMPLATES
- echo " defaults: d-i-manual-html-po2xml" >> $JOB_TEMPLATES
- echo " name: '{name}_manual_${DIRECTORY}_html'" >> $JOB_TEMPLATES
- fi
- #
- # pdf build job
- #
- if [ ! -d ~jenkins/jobs/${DI_MANUAL_JOB_PATTERN}${DIRECTORY}_pdf_po2xml ] ; then
- echo "Warning: No build job '${DI_MANUAL_JOB_PATTERN}${DIRECTORY}_pdf_po2xml'."
- FAIL=true
- #
- # prepare yaml bits
- #
- echo " - '{name}_manual_${DIRECTORY}_pdf':" >> $PROJECT_JOBS
- echo " lang: '$DIRECTORY'" >> $PROJECT_JOBS
- echo " languagename: 'FIXME: $DIRECTORY'" >> $PROJECT_JOBS
- echo "- job-template:" >> $JOB_TEMPLATES
- echo " defaults: d-i-manual-pdf-po2ml" >> $JOB_TEMPLATES
- echo " name: '{name}_manual_${DIRECTORY}_pdf'" >> $JOB_TEMPLATES
- fi
+ for FORMAT in "pdf html" ; do
+ if [ ! -d ~jenkins/jobs/${DI_MANUAL_JOB_PATTERN}${DIRECTORY}_${FORMAT}_po2xml ] ; then
+ echo "Warning: No build job '${DI_MANUAL_JOB_PATTERN}${DIRECTORY}_${FORMAT}_po2xml'."
+ FAIL=true
+ #
+ # prepare yaml bits
+ #
+ echo " - '{name}_manual_${DIRECTORY}_${FORMAT}':" >> $PROJECT_JOBS
+ echo " lang: '$DIRECTORY'" >> $PROJECT_JOBS
+ echo " languagename: 'FIXME: $DIRECTORY'" >> $PROJECT_JOBS
+ echo "- job-template:" >> $JOB_TEMPLATES
+ echo " defaults: d-i-manual-${FORMAT}-po2xml" >> $JOB_TEMPLATES
+ echo " name: '{name}_manual_${DIRECTORY}_${FORMAT}'" >> $JOB_TEMPLATES
+ fi
+ done
fi
done
# FIXME: check for removed manuals (but with existing jobs) missing