From 7a7c61105c87ac4cccea9c39c23691b0a61f9836 Mon Sep 17 00:00:00 2001 From: Rishabh Nambiar Date: Fri, 1 Sep 2017 11:06:21 +0000 Subject: [PATCH] Add default ERPNext installation to Easy Install script (develop) (#473) * Added ERPNext to Easy Install * fix site_name issue * fix site_name issue * uncomment * fix -ask password * Added ERPNext install to centos, debian, macosx * Set site1.local as default sitename * Update README.md * Restrict ERPNext installation for production * Added checks for existing sites and apps * Included setup_erpnext.yml in setup_dev_env.yml * Fixed erpnext ImportError issue with bench new-site command. --- README.md | 3 ++- playbooks/develop/centos.yml | 3 ++- playbooks/develop/debian.yml | 1 + playbooks/develop/includes/setup_dev_env.yml | 4 +++ playbooks/develop/includes/setup_erpnext.yml | 27 ++++++++++++++++++++ playbooks/develop/macosx.yml | 1 + playbooks/develop/ubuntu.yml | 1 + 7 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 playbooks/develop/includes/setup_erpnext.yml diff --git a/README.md b/README.md index 487c3946..2b3248c4 100755 --- a/README.md +++ b/README.md @@ -85,6 +85,7 @@ Note: Please do not remove the bench directory the above commands will create - You may also have to install build-essential and python-setuptools by running `apt-get install build-essential python-setuptools` - This script will install the pre-requisites, install bench and setup an ERPNext site - Passwords for Frappe Administrator and MariaDB (root) will be asked +- MariaDB (root) password may be `password` on a fresh server - You can then login as **Administrator** with the Administrator password - If you find any problems, post them on the forum: [https://discuss.erpnext.com](https://discuss.erpnext.com) @@ -126,7 +127,7 @@ For production: - Install all the pre-requisites - Install the command line `bench` - Create a new bench (a folder that will contain your entire frappe/erpnext setup) -- Create a new site on the bench +- Create a new ERPNext site on the bench #### How do I start ERPNext diff --git a/playbooks/develop/centos.yml b/playbooks/develop/centos.yml index 8090340d..206f970f 100755 --- a/playbooks/develop/centos.yml +++ b/playbooks/develop/centos.yml @@ -13,7 +13,7 @@ become: yes become_user: root - - name: install prequisites + - name: install prerequisites yum: pkg={{ item }} state=present with_items: # basic installs @@ -84,3 +84,4 @@ # setup development environment - include: includes/setup_dev_env.yml when: not run_travis and not production + \ No newline at end of file diff --git a/playbooks/develop/debian.yml b/playbooks/develop/debian.yml index 767d2b6a..d9869a71 100755 --- a/playbooks/develop/debian.yml +++ b/playbooks/develop/debian.yml @@ -124,3 +124,4 @@ # setup development environment - include: includes/setup_dev_env.yml when: not production and not run_travis + diff --git a/playbooks/develop/includes/setup_dev_env.yml b/playbooks/develop/includes/setup_dev_env.yml index 4e07360e..31e38de2 100644 --- a/playbooks/develop/includes/setup_dev_env.yml +++ b/playbooks/develop/includes/setup_dev_env.yml @@ -14,3 +14,7 @@ args: creates: "{{ bench_path }}/config/redis_socketio.conf" chdir: "{{ bench_path }}" + + + # Setup an ERPNext site called site1.local + - include: includes/setup_erpnext.yml \ No newline at end of file diff --git a/playbooks/develop/includes/setup_erpnext.yml b/playbooks/develop/includes/setup_erpnext.yml new file mode 100644 index 00000000..141c0dc4 --- /dev/null +++ b/playbooks/develop/includes/setup_erpnext.yml @@ -0,0 +1,27 @@ +--- + - name: Check if ERPNext App exists + stat: path="{{ bench_path }}/apps/erpnext" + register: app + + - name: get erpnext + command: bench get-app erpnext https://github.com/frappe/erpnext --branch {{ branch }} + args: + creates: "{{ bench_path }}/apps/erpnext" + chdir: "{{ bench_path }}" + when: not app.stat.exists + + - name: Check whether a site called site1.local exists + stat: path="{{ bench_path }}/sites/site1.local" + register: site_folder + + - name: create a new default site + command: bench new-site site1.local --admin-password {{ admin_password }} --mariadb-root-password {{ mysql_root_password }} + args: + chdir: "{{ bench_path }}" + when: not site_folder.stat.exists + + - name: install erpnext to default site + command: bench --site site1.local install-app erpnext + args: + chdir: "{{ bench_path }}" + diff --git a/playbooks/develop/macosx.yml b/playbooks/develop/macosx.yml index 0a846562..94043dc8 100644 --- a/playbooks/develop/macosx.yml +++ b/playbooks/develop/macosx.yml @@ -32,3 +32,4 @@ # setup development environment - include: includes/setup_dev_env.yml when: not production + \ No newline at end of file diff --git a/playbooks/develop/ubuntu.yml b/playbooks/develop/ubuntu.yml index c2d433a4..983d481e 100644 --- a/playbooks/develop/ubuntu.yml +++ b/playbooks/develop/ubuntu.yml @@ -107,3 +107,4 @@ # setup development environment - include: includes/setup_dev_env.yml when: not production and not run_travis and not without_bench_setup + \ No newline at end of file