2
0
mirror of https://github.com/frappe/bench.git synced 2024-11-14 09:14:04 +00:00

Merge pull request #819 from sahil28297/version_arg

fix(easy_install): add version argument for installing different versions
This commit is contained in:
Saurabh 2019-07-22 17:56:44 +05:30 committed by GitHub
commit 6d4df81412
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -108,16 +108,24 @@ def install_bench(args):
if args.production: if args.production:
extra_vars.update(max_worker_connections=multiprocessing.cpu_count() * 1024) extra_vars.update(max_worker_connections=multiprocessing.cpu_count() * 1024)
if args.version:
if args.version <= 10:
frappe_branch = "{0}.x.x".format(args.version)
erpnext_branch = "{0}.x.x".format(args.version)
else:
frappe_branch = "version-{0}".format(args.version)
erpnext_branch = "version-{0}".format(args.version)
else:
if args.frappe_branch: if args.frappe_branch:
frappe_branch = args.frappe_branch frappe_branch = args.frappe_branch
else: else:
frappe_branch = 'master' if args.production else 'develop' frappe_branch = 'version-12'
extra_vars.update(frappe_branch=frappe_branch) extra_vars.update(frappe_branch=frappe_branch)
if args.erpnext_branch: if args.erpnext_branch:
erpnext_branch = args.erpnext_branch erpnext_branch = args.erpnext_branch
else: else:
erpnext_branch = 'master' if args.production else 'develop' erpnext_branch = 'version-12'
extra_vars.update(erpnext_branch=erpnext_branch) extra_vars.update(erpnext_branch=erpnext_branch)
bench_name = 'frappe-bench' if not args.bench_name else args.bench_name bench_name = 'frappe-bench' if not args.bench_name else args.bench_name
@ -367,6 +375,10 @@ def parse_commandline_args():
parser.add_argument('--without-erpnext', dest='without_erpnext', action='store_true', default=False, parser.add_argument('--without-erpnext', dest='without_erpnext', action='store_true', default=False,
help='Prevent fetching ERPNext') help='Prevent fetching ERPNext')
# direct provision to install versions
parser.add_argument('--version', dest='version', action='store', default='12', type=int,
help='Clone particular version of frappe and erpnext')
# To enable testing of script using Travis, this should skip the prompt # To enable testing of script using Travis, this should skip the prompt
parser.add_argument('--run-travis', dest='run_travis', action='store_true', default=False, parser.add_argument('--run-travis', dest='run_travis', action='store_true', default=False,
help=argparse.SUPPRESS) help=argparse.SUPPRESS)