mirror of
https://github.com/frappe/bench.git
synced 2024-11-13 16:56:33 +00:00
Merge pull request #186 from pdvyas/fix-prod
[Fix] Simplify and fix prod config symlinking
This commit is contained in:
commit
e5c8966a00
@ -61,17 +61,15 @@ def setup_production(user, bench='.'):
|
|||||||
else:
|
else:
|
||||||
supervisor_conf_filename = 'frappe.conf'
|
supervisor_conf_filename = 'frappe.conf'
|
||||||
|
|
||||||
supervisor_conf_path = os.path.join(get_supervisor_confdir(), supervisor_conf_filename)
|
|
||||||
supervisor_sym_link_path = os.path.abspath(os.path.join(bench, 'config', 'supervisor.conf'))
|
|
||||||
|
|
||||||
nginx_conf_path = '/etc/nginx/conf.d/frappe.conf'
|
links = (
|
||||||
nginx_sym_link_path = os.path.abspath(os.path.join(bench, 'config', 'nginx.conf'))
|
(os.path.abspath(os.path.join(bench, 'config', 'nginx.conf')), '/etc/nginx/conf.d/frappe.conf'),
|
||||||
|
(os.path.abspath(os.path.join(bench, 'config', 'supervisor.conf')), os.path.join(get_supervisor_confdir(), supervisor_conf_filename)),
|
||||||
|
)
|
||||||
|
|
||||||
if not os.path.exists(supervisor_sym_link_path):
|
for src, dest in links:
|
||||||
os.symlink(supervisor_sym_link_path, supervisor_conf_path)
|
if not os.path.exists(dest):
|
||||||
|
os.symlink(src, dest)
|
||||||
if not os.path.exists(nginx_sym_link_path):
|
|
||||||
os.symlink(supervisor_sym_link_path, nginx_conf_path)
|
|
||||||
|
|
||||||
exec_cmd('supervisorctl reload')
|
exec_cmd('supervisorctl reload')
|
||||||
if os.environ.get('NO_SERVICE_RESTART'):
|
if os.environ.get('NO_SERVICE_RESTART'):
|
||||||
|
Loading…
Reference in New Issue
Block a user