PageRenderTime 182ms CodeModel.GetById 80ms app.highlight 3ms RepoModel.GetById 98ms app.codeStats 0ms

/silverlining/mgr-scripts/update-appdata.py

https://bitbucket.org/ianb/silverlining/
Python | 27 lines | 25 code | 1 blank | 1 comment | 1 complexity | 34f3bbd1ec092bde093dada6a95f981d MD5 | raw file
 1#!/usr/bin/env python
 2import sys
 3sys.path.insert(0, '/usr/local/share/silverlining/lib')
 4from silversupport.appdata import add_appdata
 5from silversupport.appconfig import AppConfig
 6from optparse import OptionParser
 7
 8parser = OptionParser(
 9    usage="%prog INSTANCE_NAME LOCATION1 LOCATION2 ...",
10    description="""\
11Updates /var/www/appdata.map
12This sets the new hostname(s) (HOSTNAME1 etc) to point to INSTANCE_NAME.
13Also the app.ini is read to write other metadata that Apache reads.
14""")
15
16parser.add_option(
17    '--debug-single-process',
18    action='store_true',
19    help="Deploy the app as a single-process threaded app for debugging")
20
21if __name__ == '__main__':
22    options, args = parser.parse_args()
23    instance_name = args[0]
24    app_config = AppConfig.from_instance_name(instance_name)
25    add_appdata(app_config, args[1:], debug_single_process=options.debug_single_process)
26    if app_config.platform == 'php':
27        app_config.write_php_env()