2
0
mirror of https://github.com/frappe/bench.git synced 2024-11-12 00:06:36 +00:00
bench/README.md

153 lines
6.5 KiB
Markdown
Raw Normal View History

<div align="center">
<img src="https://github.com/frappe/design/raw/master/logos/png/bench-logo.png" height="128">
<h2>bench</h2>
</div>
2016-09-22 10:21:15 +00:00
bench is a command-line utility that helps you to install apps, manage multiple sites and update Frappe / ERPNext apps on */nix (macOS, Ubuntu, Debian, CentOS, etc) for development and production.
2014-07-15 09:17:32 +00:00
2018-04-11 05:10:06 +00:00
2020-01-17 06:04:17 +00:00
> **Note**: If you are looking for easier ways to get started and evaluate ERPNext, [download the Virtual Machine](https://erpnext.com/download) or take [a free trial on erpnext.com](https://erpnext.com/pricing).
2018-04-11 05:10:06 +00:00
---
2018-04-11 05:10:06 +00:00
# Table of Contents
2016-09-22 10:21:15 +00:00
- [bench CLI](#bench-cli)
- [Usage](#usage)
- [Installation](#installation)
2020-02-24 07:21:53 +00:00
- [Custom Bench commands](#custom-bench-commands)
- [Easy Install Script](#easy-install-script)
- [Release Bench](#release-bench)
- [Guides](#guides)
- [Resources](#resources)
2020-01-17 06:04:17 +00:00
- [License](#license)
---
2016-09-22 10:21:15 +00:00
# bench CLI
2019-12-30 11:16:35 +00:00
Bench is a command line tool that helps you install, setup, manage multiple sites and apps based on Frappe Framework.
2016-09-22 10:21:15 +00:00
---
2016-09-22 10:21:15 +00:00
## Usage
2016-09-22 10:21:15 +00:00
* Create a new bench
2016-09-22 10:21:15 +00:00
bench init [bench-name]
2016-09-22 10:21:15 +00:00
* Add a site under current bench
2016-09-22 10:21:15 +00:00
bench new-site [site-name]
2016-09-22 10:21:15 +00:00
**Optional**: If the database for the site does not reside on localhost or listens on a custom port, you can use the flags `--db-host` to set a custom host and/or `--db-port` to set a custom port.
bench new-site [site-name] --db-host [custom-db-host-ip] --db-port [custom-db-port]
* Add apps to bench
2016-09-22 10:21:15 +00:00
bench get-app [app-name] [app-link]
2016-09-22 10:21:15 +00:00
* Install apps on a particular site
2016-08-01 05:44:01 +00:00
bench --site [site-name] install-app [app-name]
2020-02-24 07:21:53 +00:00
* Start bench (only for development)
bench start
* Show bench help
bench --help
2016-09-22 10:21:15 +00:00
_Note:_ Apart from `bench init`, all other bench commands have to be run having the respective bench directory as the working directory. _(`bench update` may also be run, but it's behaviour is covered in depth in the docs)_
2016-09-22 10:21:15 +00:00
2020-02-24 07:21:53 +00:00
For more in depth information on commands and usage follow [here](https://github.com/frappe/bench/blob/master/docs/commands_and_usage.md). As for a consolidated list of bench commands, go through [this page](https://github.com/frappe/bench/blob/master/docs/bench_usage.md).
---
2016-09-22 10:21:15 +00:00
## Installation
2016-09-22 10:21:15 +00:00
To do this install, you must have basic information on how Linux works and should be able to use the command-line. bench will also create nginx and supervisor config files, setup backups and much more. If you are using on a VPS make sure it has >= 1Gb of RAM or has swap setup properly.
2016-09-22 10:21:15 +00:00
2020-02-24 07:21:53 +00:00
git clone https://github.com/frappe/bench ~/.bench
pip3 install --user -e ~/.bench
2016-09-22 10:21:15 +00:00
As bench is a python application, its installation really depends on `python` + `pip` + `git`. The Frappe Framework, however has various other system dependencies like `nodejs`, `yarn`, `redis` and a database system like `mariadb` or `postgres`. Go through the [installation requirements](https://github.com/frappe/bench/blob/master/docs/installation.md) for an updated list.
2016-09-22 10:21:15 +00:00
If you have questions, please ask them on the [forum](https://discuss.erpnext.com/c/bench) under the "Install / Update" category.
2016-09-22 10:21:15 +00:00
---
2020-02-24 07:21:53 +00:00
## Custom Bench Commands
Want to utilize a bench command you've added in your custom Frappe application? [This](https://github.com/frappe/bench/blob/master/docs/bench_custom_cmd.md) guide might be of some help.
---
# Easy Install Script
2016-08-01 05:44:01 +00:00
2016-09-22 10:28:16 +00:00
- This is an opinionated setup so it is best to setup on a blank server.
- Works on Ubuntu 16.04+, CentOS 7+, Debian 8+
2019-12-30 11:16:35 +00:00
- You may have to install Python 3 and other essentials by running `apt-get install python3-minimal build-essential python3-setuptools`
- This script will install the pre-requisites, install bench and setup an ERPNext site `(site1.local under frappe-bench)`
- Passwords for Frappe Administrator and MariaDB (root) will be asked and saved under `~/passwoords.txt`
- MariaDB (root) password may be `password` on a fresh server
2016-09-22 10:28:16 +00:00
- You can then login as **Administrator** with the Administrator password
2019-12-30 11:16:35 +00:00
- The log file is saved under `/tmp/logs/install_bench.log` in case you run into any issues during the install.
- If you find any problems, post them on the forum: [https://discuss.erpnext.com](https://discuss.erpnext.com/c/bench) with the `installation_problem` under "Install / Update" category.
2016-08-01 05:44:01 +00:00
wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py
python3 install.py --production
2019-07-31 07:24:49 +00:00
Follow [Easy Install Docs](https://github.com/frappe/bench/blob/master/docs/easy_install.md) for more information.
2019-12-30 11:16:35 +00:00
---
2016-07-18 04:47:15 +00:00
# Release Bench
2016-07-18 04:47:15 +00:00
Releases can be made for [Frappe](https://github.com/frappe/frappe) apps using bench. More information about this process can be found [here](https://github.com/frappe/bench/blob/master/docs/releasing_frappe_apps.md).
2016-03-23 07:51:46 +00:00
2016-09-22 10:21:15 +00:00
---
2016-05-16 04:57:49 +00:00
# Bench Manager (GUI for Bench)
2018-07-03 08:58:48 +00:00
[Bench Manager](https://github.com/frappe/bench_manager) is a graphical user interface to emulate the functionalities of Frappe Bench. Like the command line utility it helps you install apps, manage multiple sites, update apps and much more. Install just by executing the following command in the respective bench directory.
2018-06-12 07:14:07 +00:00
bench setup manager
2018-06-12 07:14:07 +00:00
---
# Docker Install
2019-12-30 11:16:35 +00:00
1. For developer setup, you can also use the official [Frappe Docker](https://github.com/frappe/frappe_docker/).
2. The app, mariadb and redis run on individual containers.
3. This setup supports multi-tenancy and exposes the frappe-bench volume as a external storage.
4. For more details, [ead the instructions on the [Frappe Docker README](https://github.com/frappe/frappe_docker/)
2019-12-30 11:16:35 +00:00
---
# Guides
2016-05-18 12:02:51 +00:00
2018-01-16 18:31:57 +00:00
- [Configuring HTTPS](https://frappe.io/docs/user/en/bench/guides/configuring-https.html)
- [Using Let's Encrypt to setup HTTPS](https://frappe.io/docs/user/en/bench/guides/lets-encrypt-ssl-setup.html)
- [Diagnosing the Scheduler](https://frappe.io/docs/user/en/bench/guides/diagnosing-the-scheduler.html)
- [Change Hostname](https://frappe.io/docs/user/en/bench/guides/adding-custom-domains)
- [Manual Setup](https://frappe.io/docs/user/en/bench/guides/manual-setup.html)
- [Setup Production](https://frappe.io/docs/user/en/bench/guides/setup-production.html)
- [Setup Multitenancy](https://frappe.io/docs/user/en/bench/guides/setup-multitenancy.html)
- [Stopping Production](https://github.com/frappe/bench/wiki/Stopping-Production-and-starting-Development)
2014-07-16 08:39:16 +00:00
---
2014-07-21 11:18:41 +00:00
# Resources
2014-07-21 11:18:41 +00:00
2018-01-16 18:33:24 +00:00
- [Background Services](https://frappe.io/docs/user/en/bench/resources/background-services.html)
- [Bench Commands Cheat Sheet](https://frappe.io/docs/user/en/bench/resources/bench-commands-cheatsheet.html)
- [Bench Procfile](https://frappe.io/docs/user/en/bench/resources/bench-procfile.html)
2020-01-17 06:04:17 +00:00
---
# License
bench is licensed under [GNU GPLv3](LICENSE)