mirror of
https://github.com/frappe/bench.git
synced 2024-11-11 15:51:03 +00:00
[minor] fixes for new-app and new-site
This commit is contained in:
parent
36b6ffed9a
commit
f09efcb0ae
@ -50,7 +50,8 @@ def get_app(app, git_url, branch=None, bench='.', build_asset_files=True):
|
||||
|
||||
def new_app(app, bench='.'):
|
||||
logger.info('creating new app {}'.format(app))
|
||||
exec_cmd("{frappe} --make_app {apps}".format(frappe=get_frappe(bench=bench), apps=os.path.join(bench, 'apps')))
|
||||
exec_cmd("{frappe} --make_app {apps} {app}".format(frappe=get_frappe(bench=bench),
|
||||
apps=os.path.join(bench, 'apps'), app=app))
|
||||
install_app(app, bench=bench)
|
||||
|
||||
def install_app(app, bench='.'):
|
||||
|
@ -75,12 +75,14 @@ worker: sh -c 'cd sites && exec ../env/bin/python -m frappe.celery_app worker'
|
||||
workerbeat: sh -c 'cd sites && exec ../env/bin/python -m frappe.celery_app beat -s scheduler.schedule'""")
|
||||
|
||||
def new_site(site, mariadb_root_password=None, admin_password=None, bench='.'):
|
||||
import hashlib
|
||||
logger.info('creating new site {}'.format(site))
|
||||
mariadb_root_password_fragment = '--root_password {}'.format(mariadb_root_password) if mariadb_root_password else ''
|
||||
admin_password_fragment = '--admin_password {}'.format(admin_password) if admin_password else ''
|
||||
exec_cmd("{frappe} --install {site} {site} {mariadb_root_password_fragment} {admin_password_fragment}".format(
|
||||
exec_cmd("{frappe} {site} --install {db_name} {mariadb_root_password_fragment} {admin_password_fragment}".format(
|
||||
frappe=get_frappe(bench=bench),
|
||||
site=site,
|
||||
db_name = hashlib.sha1(site).hexdigest()[:10],
|
||||
mariadb_root_password_fragment=mariadb_root_password_fragment,
|
||||
admin_password_fragment=admin_password_fragment
|
||||
), cwd=os.path.join(bench, 'sites'))
|
||||
|
Loading…
Reference in New Issue
Block a user