diff --git a/bench/config/common_site_config.py b/bench/config/common_site_config.py index 02edfc3b..f99b07cb 100644 --- a/bench/config/common_site_config.py +++ b/bench/config/common_site_config.py @@ -62,7 +62,7 @@ def update_config_for_frappe(config, bench_path): if key not in config: config[key] = "redis://localhost:{0}".format(ports[key]) - for key in ('webserver_port', 'socketio_port'): + for key in ('webserver_port', 'socketio_port', 'file_watcher_port'): if key not in config: config[key] = ports[key] @@ -75,6 +75,7 @@ def make_ports(bench_path): default_ports = { "webserver_port": 8000, "socketio_port": 9000, + "file_watcher_port": 6787, "redis_queue": 11000, "redis_socketio": 12000, "redis_cache": 13000 diff --git a/bench/tests/test_init.py b/bench/tests/test_init.py index d1045a6f..1b8d63d2 100755 --- a/bench/tests/test_init.py +++ b/bench/tests/test_init.py @@ -40,6 +40,7 @@ class TestBenchInit(unittest.TestCase): self.assert_common_site_config("test-bench-1", { "webserver_port": 8000, "socketio_port": 9000, + "file_watcher_port": 6787, "redis_queue": "redis://localhost:11000", "redis_socketio": "redis://localhost:12000", "redis_cache": "redis://localhost:13000" @@ -51,6 +52,7 @@ class TestBenchInit(unittest.TestCase): self.assert_common_site_config("test-bench-2", { "webserver_port": 8001, "socketio_port": 9001, + "file_watcher_port": 6788, "redis_queue": "redis://localhost:11001", "redis_socketio": "redis://localhost:12001", "redis_cache": "redis://localhost:13001" @@ -210,7 +212,7 @@ class TestBenchInit(unittest.TestCase): self.assert_exists(python_path, "site-packages", "pip") site_packages = os.listdir(os.path.join(python_path, "site-packages")) - self.assertTrue(any(package.startswith("MySQL_python-1.2.5") for package in site_packages)) + self.assertTrue(any(package.startswith("mysqlclient-1.3.8") for package in site_packages)) def assert_config(self, bench_name): for config, search_key in ( diff --git a/playbooks/develop/create_user.yml b/playbooks/develop/create_user.yml index 306dabc1..2980ed4e 100755 --- a/playbooks/develop/create_user.yml +++ b/playbooks/develop/create_user.yml @@ -10,14 +10,24 @@ file: path: '/home/{{ frappe_user }}' mode: 'o+rx' + owner: '{{ frappe_user }}' + group: '{{ frappe_user }}' + recurse: yes when: ansible_distribution == 'Ubuntu' or ansible_distribution == 'CentOS' or ansible_distribution == 'Debian' - name: Set home folder perms file: path: '/Users/{{ frappe_user }}' mode: 'o+rx' + owner: '{{ frappe_user }}' + group: '{{ frappe_user }}' + recurse: yes when: ansible_distribution == 'MacOSX' - name: Set /tmp/.bench folder perms - command: 'chown -R {{ frappe_user }}:{{ frappe_user }} {{ repo_path }}' + file: + path: '{{ repo_path }}' + owner: '{{ frappe_user }}' + group: '{{ frappe_user }}' + recurse: yes when: ansible_distribution == 'Ubuntu' or ansible_distribution == 'CentOS' or ansible_distribution == 'Debian' \ No newline at end of file diff --git a/playbooks/develop/includes/setup_bench.yml b/playbooks/develop/includes/setup_bench.yml index f25cf9f0..7b768c4c 100644 --- a/playbooks/develop/includes/setup_bench.yml +++ b/playbooks/develop/includes/setup_bench.yml @@ -18,6 +18,12 @@ become: yes become_user: root + - name: Overwrite bench if required + file: + state: absent + path: "{{ bench_path }}" + when: overwrite + - name: Check whether bench exists stat: path="{{ bench_path }}" register: bench_stat diff --git a/playbooks/develop/includes/wkhtmltopdf.yml b/playbooks/develop/includes/wkhtmltopdf.yml index bdd7e419..7929d3c0 100644 --- a/playbooks/develop/includes/wkhtmltopdf.yml +++ b/playbooks/develop/includes/wkhtmltopdf.yml @@ -1,6 +1,6 @@ --- - name: download wkthmltox linux - get_url: url=http://download.gna.org/wkhtmltopdf/0.12/0.12.3/wkhtmltox-0.12.3_linux-generic-{{ "amd64" if ansible_architecture == "x86_64" else "i386"}}.tar.xz dest=/tmp/wkhtmltox.tar.xz + get_url: url=http://downloads.wkhtmltopdf.org/0.12/0.12.3/wkhtmltox-0.12.3_linux-generic-{{ "amd64" if ansible_architecture == "x86_64" else "i386"}}.tar.xz dest=/tmp/wkhtmltox.tar.xz - name: Creates directory file: path=/tmp/wkhtmltox state=directory diff --git a/playbooks/install.py b/playbooks/install.py index 657cf465..65e6f35d 100755 --- a/playbooks/install.py +++ b/playbooks/install.py @@ -335,6 +335,10 @@ def parse_commandline_args(): parser.add_argument('--without-bench-setup', dest='without_bench_setup', action='store_true', default=False, help=argparse.SUPPRESS) + # whether to overwrite an existing bench + parser.add_argument('--overwrite', dest='overwrite', action='store_true', default=False, + help='Whether to overwrite an existing bench') + args = parser.parse_args() return args