Mercurial > treepkg
comparison bin/publishstaticweb.py @ 158:8ec9ed76d67b
Make the template used by bin/publishstaticweb.py configurable.
author | Bernhard Herzog <bh@intevation.de> |
---|---|
date | Tue, 17 Jun 2008 18:06:21 +0000 |
parents | 9a602d8eaa60 |
children | 1fcdffbeb9de |
comparison
equal
deleted
inserted
replaced
157:13de20d2db9f | 158:8ec9ed76d67b |
---|---|
1 #! /usr/bin/python2.4 | 1 #! /usr/bin/python2.4 |
2 # Copyright (C) 2007 by Intevation GmbH | 2 # Copyright (C) 2007, 2008 by Intevation GmbH |
3 # Authors: | 3 # Authors: |
4 # Bernhard Herzog <bh@intevation.de> | 4 # Bernhard Herzog <bh@intevation.de> |
5 # | 5 # |
6 # This program is free software under the GPL (>=v2) | 6 # This program is free software under the GPL (>=v2) |
7 # Read the file COPYING coming with the software for details. | 7 # Read the file COPYING coming with the software for details. |
26 """ | 26 """ |
27 Applies os.path.expanduser and os.path.expandvars to filename | 27 Applies os.path.expanduser and os.path.expandvars to filename |
28 """ | 28 """ |
29 return os.path.expandvars(os.path.expanduser(filename)) | 29 return os.path.expandvars(os.path.expanduser(filename)) |
30 | 30 |
31 staticweb_desc = ["build_user", "build_host", "build_create", | 31 staticweb_desc = ["build_user", "build_host", "build_create", "build_template", |
32 ("build_dir", remove_trailing_slashes), | 32 ("build_dir", remove_trailing_slashes), |
33 "publish_user", "publish_host", | 33 "publish_user", "publish_host", |
34 ("publish_dir", remove_trailing_slashes), | 34 ("publish_dir", remove_trailing_slashes), |
35 ("cachedir", | 35 ("cachedir", |
36 lambda s: expand_filename(remove_trailing_slashes(s)))] | 36 lambda s: expand_filename(remove_trailing_slashes(s)))] |
51 | 51 |
52 def publish_static_site(config_filename): | 52 def publish_static_site(config_filename): |
53 config = read_config(config_filename) | 53 config = read_config(config_filename) |
54 | 54 |
55 # create web-page on build host | 55 # create web-page on build host |
56 call(cmdexpand("ssh $build_user$@$build_host $build_create $build_dir", | 56 call(cmdexpand("ssh $build_user$@$build_host $build_create" |
57 " --status-template=$build_template $build_dir", | |
57 **config)) | 58 **config)) |
58 | 59 |
59 # rsync the new web-pages to the local cache | 60 # rsync the new web-pages to the local cache |
60 ensure_directory(config["cachedir"]) | 61 ensure_directory(config["cachedir"]) |
61 call(cmdexpand("rsync -rL --delete $build_user$@$build_host:$build_dir/" | 62 call(cmdexpand("rsync -rL --delete $build_user$@$build_host:$build_dir/" |