예제 #1
0
def execute(bench_path):
	click.confirm('\nThis update will replace ERPNext\'s Redis configuration files to fix a major security issue.\n'
		'If you don\'t know what this means, type Y ;)\n\n'
		'Do you want to continue?',
		abort=True)

	generate_config(bench_path)
예제 #2
0
def post_upgrade(from_ver, to_ver, bench_path='.'):
    from .config.common_site_config import get_config
    from .config import redis
    from .config.supervisor import generate_supervisor_config
    from .config.nginx import make_nginx_conf
    conf = get_config(bench_path=bench_path)
    print("-" * 80)
    print("Your bench was upgraded to version {0}".format(to_ver))

    if conf.get('restart_supervisor_on_update'):
        redis.generate_config(bench_path=bench_path)
        generate_supervisor_config(bench_path=bench_path)
        make_nginx_conf(bench_path=bench_path)

        if from_ver == 4 and to_ver == 5:
            setup_backups(bench_path=bench_path)

        if from_ver <= 5 and to_ver == 6:
            setup_socketio(bench_path=bench_path)

        message = """
As you have setup your bench for production, you will have to reload configuration for nginx and supervisor. To complete the migration, please run the following commands
sudo service nginx restart
sudo supervisorctl reload
		""".strip()
        print(message)
예제 #3
0
파일: utils.py 프로젝트: bala07123/erp
def init(path, apps_path=None, no_procfile=False, no_backups=False, no_auto_update=False,
		frappe_path=None, frappe_branch=None, wheel_cache_dir=None, verbose=False, clone_from=None,
		skip_redis_config_generation=False, clone_without_update=False, ignore_exist = False, skip_assets=False, python='python3'):
	from bench.app import get_app, install_apps_from_path
	from bench.config import redis
	from bench.config.common_site_config import make_config
	from bench.config.procfile import setup_procfile
	from bench.patches import set_all_patches_executed

	if os.path.exists(path) and not ignore_exist:
		log('Path {path} already exists!'.format(path=path))
		sys.exit(0)
	elif not os.path.exists(path):
		# only create dir if it does not exist
		os.makedirs(path)

	for dirname in folders_in_bench:
		try:
			os.makedirs(os.path.join(path, dirname))
		except OSError as e:
			if e.errno == errno.EEXIST:
				pass

	setup_logging()

	setup_env(bench_path=path, python=python)

	make_config(path)

	if clone_from:
		clone_apps_from(bench_path=path, clone_from=clone_from, update_app=not clone_without_update)
	else:
		if not frappe_path:
			frappe_path = 'https://github.com/frappe/frappe.git'

		get_app(frappe_path, branch=frappe_branch, bench_path=path, skip_assets=True, verbose=verbose)

		if apps_path:
			install_apps_from_path(apps_path, bench_path=path)


	bench.set_frappe_version(bench_path=path)
	if bench.FRAPPE_VERSION > 5:
		if not skip_assets:
			update_node_packages(bench_path=path)

	set_all_patches_executed(bench_path=path)
	if not skip_assets:
		build_assets(bench_path=path)

	if not skip_redis_config_generation:
		redis.generate_config(path)

	if not no_procfile:
		setup_procfile(path)
	if not no_backups:
		setup_backups(bench_path=path)
	if not no_auto_update:
		setup_auto_update(bench_path=path)
	copy_patches_txt(path)
예제 #4
0
def execute(bench_path):
    click.confirm(
        '\nThis update will replace ERPNext\'s Redis configuration files to fix a major security issue.\n'
        'If you don\'t know what this means, type Y ;)\n\n'
        'Do you want to continue?',
        abort=True)

    generate_config(bench_path)
예제 #5
0
def setup_redis():
    "generate config for redis cache"
    from bench.config.redis import generate_config
    generate_config('.')
예제 #6
0
파일: setup.py 프로젝트: kossanah/bench
def setup_redis():
	"generate config for redis cache"
	from bench.config.redis import generate_config
	generate_config('.')
예제 #7
0
def setup_redis():
    from bench.config.redis import generate_config
    generate_config(".")