2
0
mirror of https://github.com/frappe/bench.git synced 2025-01-24 15:38:25 +00:00

[fix] provision to specify bench name explicitly

This commit is contained in:
Saurabh 2017-08-28 19:10:38 +05:30
parent ead5dbf9a6
commit e360b0702a
3 changed files with 5 additions and 41 deletions

View File

@ -19,7 +19,7 @@
hosts: localhost
vars:
bench_repo_path: "/home/{{ ansible_user_id }}/.bench"
bench_path: "/home/{{ ansible_user_id }}/frappe-bench"
bench_path: "/home/{{ ansible_user_id }}/{{ bench_name }}"
tasks:
# setup frappe-bench
- include: includes/setup_bench.yml

View File

@ -1,40 +0,0 @@
---
- name: Install MySQLdb in global env
pip: name=mysql-python version=1.2.5
become: yes
become_user: root
- name: Add configuration
template: src={{ mysql_config_template }} dest={{ mysql_conf_dir }}/frappe.cnf owner=root mode=0644
become: yes
become_user: root
- name: restart mysql linux
service: name=mysql state=restarted
become: yes
become_user: root
when: ansible_os_family == 'RedHat' or ansible_os_family == 'Debian'
- name: Set root Password
command: mysqladmin -u root password {{ mysql_root_password }}
become: yes
become_user: root
when: mysql_root_password is defined
# incase root password is already set
ignore_errors: yes
- name: add launchagents folder mac
file: path=~/Library/LaunchAgents state=directory
when: ansible_distribution == 'MacOSX'
- name: add mysql to mac startup
file: src=/usr/local/opt/mariadb/homebrew.mxcl.mariadb.plist path=~/Library/LaunchAgents/homebrew.mxcl.mariadb.plist state=link force=yes
when: ansible_distribution == 'MacOSX'
- name: stop mysql mac
command: launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.mariadb.plist
when: ansible_distribution == 'MacOSX'
- name: start mysql mac
command: launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mariadb.plist
when: ansible_distribution == 'MacOSX'

View File

@ -104,6 +104,9 @@ def install_bench(args):
branch = 'master' if args.production else 'develop'
extra_vars.update(branch=branch)
bench_name = 'frappe-bench' if not args.bench_name else args.bench_name
extra_vars.update(bench_name=bench_name)
if args.develop:
run_playbook('develop/install.yml', sudo=True, extra_vars=extra_vars)
@ -364,6 +367,7 @@ def parse_commandline_args():
# set passwords
parser.add_argument('--mysql-root-password', dest='mysql_root_password', help='Set mysql root password')
parser.add_argument('--admin-password', dest='admin_password', help='Set admin password')
parser.add_argument('--bench-name', dest='bench_name', help='Create bench with specified name. Default name is frappe-bench')
args = parser.parse_args()