2
0
mirror of https://github.com/frappe/bench.git synced 2025-01-09 16:36:25 +00:00

install modules

This commit is contained in:
Saurabh 2017-09-08 21:23:35 +05:30
parent ffd6ad7c12
commit 802fa1e239
3 changed files with 52 additions and 7 deletions

View File

@ -68,3 +68,6 @@ from bench.commands.git import remote_set_url, remote_reset_url, remote_urls
bench_command.add_command(remote_set_url)
bench_command.add_command(remote_reset_url)
bench_command.add_command(remote_urls)
from bench.commands.install import install
bench_command.add_command(install)

49
bench/commands/install.py Normal file
View File

@ -0,0 +1,49 @@
import os, sys, json, click
from bench.utils import run_playbook
extra_vars = {"production": True}
@click.group()
def install():
"Install system dependancies"
pass
@click.command('prerequisites')
def install_prerequisites():
"Install prerequisites"
run_playbook('prerequisites/install_prerequisites.yml')
@click.command('mariadb')
@click.option('--mysql_root_password')
def install_maridb(mysql_root_password=''):
"Install mariadb 10.1"
extra_vars.update(mysql_root_password)
run_playbook('prerequisites/install_roles.yml', extra_vars=extra_vars, tag='maridb')
@click.command('wkhtmltopdf')
def install_wkhtmltopdf():
run_playbook('prerequisites/install_roles.yml', extra_vars=extra_vars, tag='wkhtmltopdf')
@click.command('nodejs')
def install_nodejs():
run_playbook('prerequisites/install_roles.yml', extra_vars=extra_vars, tag='nodejs')
@click.command('psutil')
def install_psutil():
run_playbook('prerequisites/install_roles.yml', extra_vars=extra_vars, tag='psutil')
@click.command('nginx')
def install_nginx():
run_playbook('prerequisites/install_roles.yml', extra_vars=extra_vars, tag='nginx')
@click.command('fail2ban')
def install_failtoban():
run_playbook('prerequisites/install_roles.yml', extra_vars=extra_vars, tag='fail2ban')
install.add_command(install_prerequisites)
install.add_command(install_maridb)
install.add_command(install_wkhtmltopdf)
install.add_command(install_nodejs)
install.add_command(install_psutil)
install.add_command(install_nginx)
install.add_command(install_failtoban)

View File

@ -191,12 +191,6 @@ def sync_domains(domain=None, site=None):
# if changed, success, else failure
sys.exit(0 if changed else 1)
@click.command('prerequisites')
def setup_prerequisites():
"Install prerequisites"
from bench.utils import run_playbook
run_playbook('prerequisites/install_prerequisites.yml')
@click.command('role')
@click.argument('role')
@click.option('--admin_emails', default='')
@ -234,5 +228,4 @@ setup.add_command(remove_domain)
setup.add_command(sync_domains)
setup.add_command(setup_firewall)
setup.add_command(set_ssh_port)
setup.add_command(setup_prerequisites)
setup.add_command(setup_roles)