[svnbook] r4965 committed - Add support for per-build notification targets, and notify Jens of the...

svnbook at googlecode.com svnbook at googlecode.com
Fri Jan 16 10:01:49 CST 2015


Revision: 4965
Author:   cmpilato at gmail.com
Date:     Fri Jan 16 16:01:39 2015 UTC
Log:      Add support for per-build notification targets, and notify Jens  
of the
'de' build failures.

* www/bin/build-and-deploy.py
   (parse_commasep_option): New helper method.
   (main): Use new parse_commasep_option() method.  Also, send mail
     also to the per-build report_targets.

* www/bin/build-and-deploy.conf
   (de-1.8, de-1.7): Add report_targets configury.

https://code.google.com/p/svnbook/source/detail?r=4965

Modified:
  /trunk/en/book/book.xml
  /trunk/tools/base-html-stylesheet.xsl
  /www/bin/build-and-deploy.conf
  /www/bin/build-and-deploy.py

=======================================
--- /trunk/en/book/book.xml	Tue Nov 25 15:21:12 2014 UTC
+++ /trunk/en/book/book.xml	Fri Jan 16 16:01:39 2015 UTC
@@ -43,7 +43,7 @@
  <book id="svn">
    <title>Version Control with Subversion [DRAFT]</title>

-  <bookinfo>
+  <bookinfort>

      <subtitle>For Subversion 1.8</subtitle>

=======================================
--- /trunk/tools/base-html-stylesheet.xsl	Fri Feb 15 00:54:50 2013 UTC
+++ /trunk/tools/base-html-stylesheet.xsl	Fri Jan 16 16:01:39 2015 UTC
@@ -17,7 +17,8 @@
    <xsl:param name="callout.graphics" select="1" />
    <xsl:param name="callout.graphics.extension">.png</xsl:param>

-  <xsl:param name="ignore.image.scaling" select="1" />
+  <xsl:param name="pixels.per.inch">120</xsl:param>
+  <!-- <xsl:param name="ignore.image.scaling" select="1" /> -->

    <xsl:template match="sect1" mode="toc">
      <xsl:param name="toc-context" select="."/>
=======================================
--- /www/bin/build-and-deploy.conf	Tue Nov 25 17:37:05 2014 UTC
+++ /www/bin/build-and-deploy.conf	Fri Jan 16 16:01:39 2015 UTC
@@ -42,10 +42,12 @@
  [de-1.8]
  locale = de
  version = 1.8
+report_targets = jmfelderhoff at gmx.eu

  [de-1.7]
  locale = de
  version = 1.7
+report_targets = jmfelderhoff at gmx.eu

  [fr]
  locale = fr
=======================================
--- /www/bin/build-and-deploy.py	Tue Nov 25 16:34:36 2014 UTC
+++ /www/bin/build-and-deploy.py	Fri Jan 16 16:01:39 2015 UTC
@@ -59,6 +59,10 @@
  #    # to "0".
  #    adsense = "0" | "1"
  #
+#    # A comma-delimited set of email addresses to which notification
+#    # emails should be sent for this build only.
+#    report_targets =
+#
  #    [BUILD-NAME2]
  #    ...
  #
@@ -86,6 +90,7 @@
  #    locale = de
  #    version = 1.5
  #    formats = html, html-chunk
+#    report_targets = maintainer at svnbook.de
  # ----------------------------------------------------------------------


@@ -394,6 +399,16 @@
      return cfg.get(section, option) or default_value


+def parse_commasep_option(value):
+    """Parse an option value string designed to be interpreted as a
+    comma-separated list of values, trimming whitespace around each
+    value.  Return the list."""
+
+    if not value:
+        return []
+    return map(lambda x: x.strip(), value.split(','))
+
+
  def main(conf_file, dry_run, verbose):
      """Read CONF_FILE and attempt the builds described there.  If
      DRY_RUN is set, don't really do anything.  If VERBOSE is set, be
@@ -433,9 +448,13 @@
                                'branches/%s/%s' % (version, locale))
          dst_path = get_option(cfg, section, 'dst_path',
                                'www/%s/%s' % (locale, version))
-        formats = map(lambda x: x.strip(),
-                      get_option(cfg, section, 'formats',
-                                 'html, html-chunk, pdf').split(','))
+        formats = parse_commasep_option(get_option(cfg, section, 'formats',
+                                                   'html, html-chunk,  
pdf'))
+        mail_tos = parse_commasep_option(get_option(cfg, section,
+                                                    'report_targets'))
+        if mail_to:
+            mail_tos.append(mail_to)
+
          build_log = os.path.join(dst_path, 'nightly-build.log')
          try:
              build_begin_time = time.time()
@@ -451,9 +470,10 @@
                  body = "The svnbook build for the '%s' locale has  
failed.\n" \
                         "Please investigate.\n\n%s\n" \
                         "-- Svnbook Build Daemon.\n" % (locale, build_log)
-                if mail_to and mail_from:
-                    sendmail(mail_from, mail_from_name, mail_to,
-                             "Build Failure Alert: '%s'" % locale, body)
+                if mail_tos and mail_from:
+                    for mail_to in mail_tos:
+                        sendmail(mail_from, mail_from_name, mail_to,
+                                 "Build Failure Alert: '%s'" % locale,  
body)
                  else:
                      sys.stderr.write(body)
                      sys.stderr.write(str(e) + "\n")



More information about the svnbook-dev mailing list