diff bin/publishstaticweb.py @ 338:28df50b267f6

Expanded the pkg_revision_template dictionary to include rules revision
author Andre Heinecke <aheinecke@intevation.de>
date Tue, 13 Apr 2010 09:53:19 +0000
parents dba1b6b825ec
children ef87d30468b6
line wrap: on
line diff
--- a/bin/publishstaticweb.py	Tue Apr 13 09:48:19 2010 +0000
+++ b/bin/publishstaticweb.py	Tue Apr 13 09:53:19 2010 +0000
@@ -44,11 +44,16 @@
     parser = OptionParser()
     parser.set_defaults(config_file=os.path.join(treepkgcmd.topdir,
                                                  "staticweb.cfg"))
+    parser.set_defaults(update_cache_only=False)
     parser.add_option("--config-file",
                       help=("The configuration file. Default is staticweb.cfg"))
+    parser.add_option("--update-cache-only", action="store_true",
+                      help=("Stop after updating the cache."
+                            " This omits the last step of the publishing"
+                            " process"))
     return parser.parse_args()
 
-def publish_static_site(config_filename):
+def publish_static_site(config_filename, update_cache_only=False):
     config = read_config(config_filename)
 
     # create web-page on build host
@@ -62,14 +67,15 @@
                    " $cachedir",
                    **config))
 
-    # rsync the web pages from the local cache to the publishing host
-    call(cmdexpand("rsync -rL --delete $cachedir/"
-                   " $publish_user$@$publish_host:$publish_dir",
-                   **config))
+    if not update_cache_only:
+        # rsync the web pages from the local cache to the publishing host
+        call(cmdexpand("rsync -rL --delete $cachedir/"
+                       " $publish_user$@$publish_host:$publish_dir",
+                       **config))
 
 
 def main():
     options, args = parse_commandline()
-    publish_static_site(options.config_file)
+    publish_static_site(options.config_file, options.update_cache_only)
 
 main()
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)