Mercurial > treepkg > treepkg
comparison bin/publishstaticweb.py @ 578:bccd69dedbe5
shlex.split all config parameters that may contain a command
Return the command as list and use @ operator for the variable in cmdexpand
author | Bjoern Ricks <bricks@intevation.de> |
---|---|
date | Sat, 03 Sep 2011 11:53:12 +0000 |
parents | ef87d30468b6 |
children |
comparison
equal
deleted
inserted
replaced
577:7a9841e4958f | 578:bccd69dedbe5 |
---|---|
7 # Read the file COPYING coming with the software for details. | 7 # Read the file COPYING coming with the software for details. |
8 | 8 |
9 """Publishes a static web-site with a status report""" | 9 """Publishes a static web-site with a status report""" |
10 | 10 |
11 import sys | 11 import sys |
12 import shlex | |
12 import os | 13 import os |
13 from optparse import OptionParser | 14 from optparse import OptionParser |
14 from ConfigParser import SafeConfigParser | 15 from ConfigParser import SafeConfigParser |
15 | 16 |
16 import treepkgcmd | 17 import treepkgcmd |
26 """ | 27 """ |
27 Applies os.path.expanduser and os.path.expandvars to filename | 28 Applies os.path.expanduser and os.path.expandvars to filename |
28 """ | 29 """ |
29 return os.path.expandvars(os.path.expanduser(filename)) | 30 return os.path.expandvars(os.path.expanduser(filename)) |
30 | 31 |
31 staticweb_desc = ["build_user", "build_host", "build_create", "build_template", | 32 staticweb_desc = ["build_user", "build_host", |
33 ("build_create", shlex.split), "build_template", | |
32 "build_logs", | 34 "build_logs", |
33 ("build_dir", remove_trailing_slashes), | 35 ("build_dir", remove_trailing_slashes), |
34 "publish_user", "publish_host", | 36 "publish_user", "publish_host", |
35 ("publish_dir", remove_trailing_slashes), | 37 ("publish_dir", remove_trailing_slashes), |
36 ("cachedir", | 38 ("cachedir", |
62 | 64 |
63 def publish_static_site(config_filename, update_cache_only=False): | 65 def publish_static_site(config_filename, update_cache_only=False): |
64 config = read_config(config_filename) | 66 config = read_config(config_filename) |
65 | 67 |
66 # create web-page on build host | 68 # create web-page on build host |
67 call(cmdexpand("ssh $build_user$@$build_host $build_create" | 69 call(cmdexpand("ssh $build_user$@$build_host @build_create" |
68 " --show-logs=$build_logs" | 70 " --show-logs=$build_logs" |
69 " --status-template=$build_template $build_dir", | 71 " --status-template=$build_template $build_dir", |
70 **config)) | 72 **config)) |
71 | 73 |
72 # rsync the new web-pages to the local cache | 74 # rsync the new web-pages to the local cache |