2
0
mirror of https://github.com/frappe/bench.git synced 2024-11-11 15:51:03 +00:00

add set-url-root command

This commit is contained in:
Pratik Vyas 2014-11-19 12:39:37 +05:30
parent ae1992f625
commit 6bcfa5b313
2 changed files with 12 additions and 1 deletions

View File

@ -8,7 +8,7 @@ from .utils import setup_sudoers as _setup_sudoers
from .utils import start as _start
from .utils import setup_procfile as _setup_procfile
from .utils import set_nginx_port as _set_nginx_port
from .utils import set_nginx_port as _set_nginx_port
from .utils import set_url_root as _set_url_root
from .utils import set_default_site as _set_default_site
from .utils import (build_assets, patch_sites, exec_cmd, update_bench, get_frappe, setup_logging,
get_config, update_config, restart_supervisor_processes, put_config, default_config, update_requirements,
@ -205,6 +205,13 @@ def set_nginx_port(site, port):
"Set nginx port for site"
_set_nginx_port(site, port)
@click.command('set-url-root')
@click.argument('site')
@click.argument('url-root')
def set_url_root(site, url_root):
"Set url root for site"
_set_url_root(site, port)
@click.command('set-mariadb-host')
@click.argument('host')
def _set_mariadb_host(host):
@ -436,3 +443,4 @@ bench.add_command(_backup_site)
bench.add_command(_prime_wheel_cache)
bench.add_command(_release)
bench.add_command(patch)
bench.add_command(set_url_root)

View File

@ -243,6 +243,9 @@ def set_nginx_port(site, port, bench='.', gen_config=True):
if gen_config:
generate_nginx_config()
def set_url_root(site, url_root, bench='.'):
update_site_config(site, {"host_name": url_root}, bench=bench)
def set_default_site(site, bench='.'):
if not site in get_sites(bench=bench):
raise Exception("Site not in bench")