2
0
mirror of https://github.com/frappe/bench.git synced 2024-09-22 20:19:01 +00:00

Merge pull request #638 from codingCoffee/frappe_erp

set repo-url and branch for frappe and erpnext
This commit is contained in:
Ameya Shenoy 2018-04-16 19:33:08 +05:30 committed by GitHub
commit 8cb621cfdd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 5 deletions

View File

@ -103,8 +103,17 @@ def install_bench(args):
if args.production:
extra_vars.update(max_worker_connections=multiprocessing.cpu_count() * 1024)
branch = 'master' if args.production else 'develop'
extra_vars.update(branch=branch)
if args.frappe_branch:
frappe_branch = args.frappe_branch
else:
frappe_branch = 'master' if args.production else 'develop'
extra_vars.update(frappe_branch=frappe_branch)
if args.erpnext_branch:
erpnext_branch = args.erpnext_branch
else:
erpnext_branch = 'master' if args.production else 'develop'
extra_vars.update(erpnext_branch=erpnext_branch)
bench_name = 'frappe-bench' if not args.bench_name else args.bench_name
extra_vars.update(bench_name=bench_name)
@ -359,6 +368,18 @@ def parse_commandline_args():
parser.add_argument('--repo-url', dest='repo_url', help='Clone bench from the given url')
parser.add_argument('--frappe-repo-url', dest='frappe_repo_url', action='store', default='https://github.com/frappe/frappe',
help='Clone frappe from the given url')
parser.add_argument('--frappe-branch', dest='frappe_branch', action='store',
help='Clone a particular branch of frappe')
parser.add_argument('--erpnext-repo-url', dest='erpnext_repo_url', action='store', default='https://github.com/frappe/erpnext',
help='Clone erpnext from the given url')
parser.add_argument('--erpnext-branch', dest='erpnext_branch', action='store',
help='Clone a particular branch of erpnext')
# 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,
help=argparse.SUPPRESS)

View File

@ -29,13 +29,13 @@
register: bench_stat
- name: python3 bench init for develop
command: bench init {{ bench_path }} --frappe-branch {{ branch }} --python {{ python }}
command: bench init {{ bench_path }} --frappe-path {{ frappe_repo_url }} --frappe-branch {{ frappe_branch }} --python {{ python }}
args:
creates: "{{ bench_path }}"
when: not bench_stat.stat.exists and not production
- name: python2 bench init for production
command: bench init {{ bench_path }} --frappe-branch {{ branch }}
command: bench init {{ bench_path }} --frappe-path {{ frappe_repo_url }} --frappe-branch {{ frappe_branch }}
args:
creates: "{{ bench_path }}"
when: not bench_stat.stat.exists and production

View File

@ -4,7 +4,7 @@
register: app
- name: Get the ERPNext app
command: bench get-app erpnext https://github.com/frappe/erpnext --branch {{ branch }}
command: bench get-app erpnext {{ erpnext_repo_url }} --branch {{ erpnext_branch }}
args:
creates: "{{ bench_path }}/apps/erpnext"
chdir: "{{ bench_path }}"