[svnbook] r5209 committed - www/bin

cmpilato at users.sourceforge.net cmpilato at users.sourceforge.net
Mon Oct 24 08:00:30 CDT 2016


Revision: 5209
          http://sourceforge.net/p/svnbook/source/5209
Author:   cmpilato
Date:     2016-10-24 13:00:29 +0000 (Mon, 24 Oct 2016)
Log Message:
-----------
Report the URL of the nightly build logfile.  We add some
configuration options (and remove an unused one) to make this happen.

* build-and-deploy.conf
  (general): Add 'www_root' and 'www_root_href' settings.

* build-and-deploy.py
  (BUILD_LOG_FILENAME): New.
  (do_build): Use BUILD_LOG_FILENAME instead of a hardcoded path.
  (main): Read 'www_root' and 'www_root_href', and use that to
    construct 'dst_path' (no longer read from configuration) and the URL
    to the build log.

Modified Paths:
--------------
    www/bin/build-and-deploy.conf
    www/bin/build-and-deploy.py

Modified: www/bin/build-and-deploy.conf
===================================================================
--- www/bin/build-and-deploy.conf	2016-10-24 11:17:54 UTC (rev 5208)
+++ www/bin/build-and-deploy.conf	2016-10-24 13:00:29 UTC (rev 5209)
@@ -4,6 +4,8 @@
 report_target = svnbook-dev at red-bean.com
 report_sender = svnbook-build-daemon at red-bean.com
 report_sender_name = Svnbook Build Daemon
+www_root_href = http://svnbook.red-bean.com
+www_root = www
 
 [en-trunk]
 locale = en

Modified: www/bin/build-and-deploy.py
===================================================================
--- www/bin/build-and-deploy.py	2016-10-24 11:17:54 UTC (rev 5208)
+++ www/bin/build-and-deploy.py	2016-10-24 13:00:29 UTC (rev 5209)
@@ -94,6 +94,7 @@
 #    report_targets = maintainer at svnbook.de
 # ----------------------------------------------------------------------
 
+BUILD_LOG_FILENAME = 'nightly-build.log'
 
 def format_duration(seconds):
     """Return a string describing SECONDS as a more pretty-printed
@@ -338,7 +339,7 @@
 
     make_cmd = (['make', 'INSTALL_SUBDIR=__TEMPINSTALL__', 'clean', 'valid']
                 + map(lambda x: 'install-%s' % x, formats))
-    build_log = os.path.join(dst_path, 'nightly-build.log')
+    build_log = os.path.join(dst_path, BUILD_LOG_FILENAME)
     log_fp = open(build_log, 'w', 1)
     log_fp.write("::: %s :::\n" % time.asctime())
 
@@ -373,8 +374,8 @@
         os.chdir(cwd)
 
     # Move stuff into place, deleting old stuff first.
-    build_log = os.path.join(dst_path, 'nightly-build.log')
-    temp_build_log = os.path.join(temp_dir, 'nightly-build.log')
+    build_log = os.path.join(dst_path, BUILD_LOG_FILENAME)
+    temp_build_log = os.path.join(temp_dir, BUILD_LOG_FILENAME)
     if verbose:
         print "Rename: %s -> %s" % (build_log, temp_build_log)
     if not dry_run:
@@ -422,6 +423,9 @@
     mail_from = get_option(cfg, 'general', 'report_sender')
     mail_from_name = get_option(cfg, 'general', 'report_sender',
                                 'SvnBook Build Daemon')
+    www_root = get_option(cfg, 'general', 'www_root', 'www')
+    www_root_href = get_option(cfg, 'general', 'www_root',
+                               'http://svnbook.red-bean.com/')
     for section in cfg.sections():
         if section == 'general':
             continue
@@ -447,8 +451,6 @@
             adsense = False
         src_path = get_option(cfg, section, 'src_path',
                               'branches/%s/%s' % (version, locale))
-        dst_path = get_option(cfg, section, 'dst_path',
-                              'www/%s/%s' % (locale, version))
         formats = parse_commasep_option(get_option(cfg, section, 'formats',
                                                    'html, html-chunk, pdf'))
         mail_tos = parse_commasep_option(get_option(cfg, section,
@@ -456,7 +458,9 @@
         if mail_to:
             mail_tos.append(mail_to)
                              
-        build_log = os.path.join(dst_path, 'nightly-build.log')
+        dst_path = '%s/%s/%s' % (www_root, locale, version)
+        build_log_href = '%s/%s/%s/%s' % (www_root_href, locale,
+                                          version, BUILD_LOG_FILENAME)
         try:
             build_begin_time = time.time()
             do_build(locale, version, src_path, dst_path, formats,
@@ -470,7 +474,7 @@
             else:
                 body = "The svnbook build for the '%s' locale has failed.\n" \
                        "Please investigate.\n\n%s\n" \
-                       "-- Svnbook Build Daemon.\n" % (locale, build_log)
+                       "-- Svnbook Build Daemon.\n" % (locale, build_log_href)
                 if mail_tos and mail_from:
                     for mail_to in mail_tos:
                         sendmail(mail_from, mail_from_name, mail_to,





More information about the svnbook-dev mailing list