2016-03-15 06:54:17 +00:00
|
|
|
---
|
2016-05-25 10:47:48 +00:00
|
|
|
- name: Check if /tmp/.bench exists
|
|
|
|
stat:
|
|
|
|
path: /tmp/.bench
|
|
|
|
register: tmp_bench
|
|
|
|
|
|
|
|
- name: Check if bench_repo_path exists
|
|
|
|
stat:
|
|
|
|
path: '{{ bench_repo_path }}'
|
|
|
|
register: bench_repo_register
|
|
|
|
|
|
|
|
- name: move /tmp/.bench if it exists
|
|
|
|
command: 'cp -R /tmp/.bench {{ bench_repo_path }}'
|
|
|
|
when: tmp_bench.stat.exists and not bench_repo_register.stat.exists
|
|
|
|
|
2016-03-15 06:54:17 +00:00
|
|
|
- name: install bench
|
|
|
|
pip: name={{ bench_repo_path }} extra_args='-e'
|
2016-03-17 09:50:21 +00:00
|
|
|
become: yes
|
|
|
|
become_user: root
|
2016-03-15 06:54:17 +00:00
|
|
|
|
2017-05-15 15:45:26 +00:00
|
|
|
- name: Overwrite bench if required
|
|
|
|
file:
|
|
|
|
state: absent
|
|
|
|
path: "{{ bench_path }}"
|
|
|
|
when: overwrite
|
|
|
|
|
2016-05-04 07:53:33 +00:00
|
|
|
- name: Check whether bench exists
|
|
|
|
stat: path="{{ bench_path }}"
|
|
|
|
register: bench_stat
|
|
|
|
|
2016-03-15 06:54:17 +00:00
|
|
|
- name: init bench
|
2016-05-04 07:53:33 +00:00
|
|
|
command: bench init {{ bench_path }} --frappe-branch {{ branch }}
|
2016-03-15 06:54:17 +00:00
|
|
|
args:
|
|
|
|
creates: "{{ bench_path }}"
|
2016-05-04 07:53:33 +00:00
|
|
|
when: not bench_stat.stat.exists
|
2016-03-15 12:41:08 +00:00
|
|
|
|
|
|
|
# setup common_site_config
|
|
|
|
- name: setup config
|
|
|
|
command: bench setup config
|
|
|
|
args:
|
|
|
|
creates: "{{ bench_path }}/sites/common_site_config.json"
|
|
|
|
chdir: "{{ bench_path }}"
|
2016-03-17 07:29:44 +00:00
|
|
|
|
2016-03-15 06:54:17 +00:00
|
|
|
- name: install frappe app
|
|
|
|
command: bench get-app frappe https://github.com/frappe/frappe
|
|
|
|
args:
|
|
|
|
creates: "{{ bench_path }}/apps/frappe"
|
|
|
|
chdir: "{{ bench_path }}"
|