2
0
mirror of https://github.com/frappe/bench.git synced 2024-11-11 15:51:03 +00:00

[minor] fixes for travis

This commit is contained in:
Rushabh Mehta 2016-08-01 11:14:01 +05:30
parent 6878440e6b
commit 94d27493d2
4 changed files with 38 additions and 47 deletions

View File

@ -10,63 +10,50 @@ If you have questions, please ask them on our [forum](https://discuss.erpnext.co
Installation
============
<table>
<tr>
<th width=50%>Production Setup</th>
<th width=50%>Development Setup</th>
</tr>
<tr>
<td>Installs with master branch</td>
<td>Installs with develop branch</td>
</tr>
<tr>
<td>The Production setup uses Nginx, and uses Supervisor to manage processes</td>
<td>The development setup uses Honcho to manage processes (bench start)</td>
</tr>
<tr>
<td>This setup isn't meant for instant updates in code.</td>
<td>Any code changes will be reflected instantly.</td>
</tr>
<tr>
<td>Background services handle all the work, and they start with the system.</td>
<td>You need to explicitly start your server</td>
</tr>
<tr>
<td>Uses Celery for job queuing (Frappe 6)</td>
<td>Uses RQ for job queuing (Frappe 7)</td>
</tr>
</table>
Easy Setup
----------
Easy Setup
---------------------
- This is an opinionated setup with logging and SE Linux. So, it is best to setup on a blank server.
- Tested on Ubuntu 14.04 to 16.04, CentOS 7+, and MacOS X. If you find any problems, post them on our forum: [https://discuss.erpnext.com](https://discuss.erpnext.com)
- This script will install the pre-requisites, install bench and setup an ERPNext site
- Passwords for Frappe Administrator and MariaDB (root) will be asked
- You can then login as **Administrator** with the Administrator password
Production vs Develop
---------------------
*Production* setup should be run on a new box and installs nginx and supervisor to manage the processes. *Develop* setup uses `honcho` to manage the processes and uses the built-in web server (`bench start`)
Steps
-----
Open your Terminal and enter:
```
# Linux:
wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py
# Linux:
# Mac OSX:
curl "https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py" -o install.py
wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py
# For development
sudo python install.py --develop
# Mac OSX:
# For production
sudo python install.py --production
# install X Code (from App store)
# install HomeBrew (http://brew.sh/)
brew install python
brew install git
curl "https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py" -o install.py
# For development
sudo python install.py --develop
# For production
sudo python install.py --production
# If you're logged in as root, use --user flag to create a user and install using that user
sudo python install.py --develop --user frappe
# If you're logged in as root, use --user flag to create a user and install using that user
sudo python install.py --develop --user frappe
```
For development, you have to explicitly start services by running `bench start`. This script requires Python2.7+ installed on your machine. You will have to manually create a new site (`bench new-site`) and get apps that you need (`bench get-app`, `bench install-app`).
For production, you will have a preinstalled site with ERPNext installed in it.
For production, you will have a preinstalled site with ERPNext installed in it.
You need to run this with a user that is **not** `root`, but can `sudo`. If you don't have such a user, you can search the web for *How to add a new user in { your OS }* and *How to add an existing user to sudoers in { your OS }*.
@ -83,7 +70,7 @@ This script will:
- NodeJS
- WKHTMLtoPDF with patched QT
- Initializes a new Bench at `~/frappe/frappe-bench` with `frappe` framework already installed under `apps`.
####Script Options:
```
--help

View File

@ -69,7 +69,8 @@
# setup frappe-bench
- include: includes/setup_bench.yml
when: not run_travis and without_bench_setup
# setup development environment
- include: includes/setup_dev_env.yml
when: not production
when: not run_travis and not production

View File

@ -93,7 +93,7 @@
# setup frappe-bench
- include: includes/setup_bench.yml
when: not run_travis
when: not without_bench_setup and not run_travis
# setup development environment
- include: includes/setup_dev_env.yml

View File

@ -88,7 +88,7 @@ def install_bench(args):
run_playbook('develop/create_user.yml', extra_vars=extra_vars)
extra_vars.update(get_passwords(args.run_travis))
extra_vars.update(get_passwords(args.run_travis or args.without_bench_setup))
if args.production:
extra_vars.update(max_worker_connections=multiprocessing.cpu_count() * 1024)
@ -176,8 +176,8 @@ def could_not_install(package):
def is_sudo_user():
return os.geteuid() == 0
def get_passwords(run_travis=False):
if not run_travis:
def get_passwords(ignore_prompt=False):
if not ignore_prompt:
mysql_root_password, admin_password = '', ''
pass_set = True
while pass_set:
@ -265,6 +265,9 @@ def parse_commandline_args():
parser.add_argument('--run-travis', dest='run_travis', action='store_true', default=False,
help=argparse.SUPPRESS)
parser.add_argument('--without-bench-setup', dest='without_bench_setup', action='store_true', default=False,
help=argparse.SUPPRESS)
args = parser.parse_args()
return args