mirror of
https://github.com/frappe/bench.git
synced 2024-11-14 17:24:04 +00:00
commit
bee3de44e4
@ -62,7 +62,7 @@ def update_config_for_frappe(config, bench_path):
|
|||||||
if key not in config:
|
if key not in config:
|
||||||
config[key] = "redis://localhost:{0}".format(ports[key])
|
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:
|
if key not in config:
|
||||||
config[key] = ports[key]
|
config[key] = ports[key]
|
||||||
|
|
||||||
@ -75,6 +75,7 @@ def make_ports(bench_path):
|
|||||||
default_ports = {
|
default_ports = {
|
||||||
"webserver_port": 8000,
|
"webserver_port": 8000,
|
||||||
"socketio_port": 9000,
|
"socketio_port": 9000,
|
||||||
|
"file_watcher_port": 6787,
|
||||||
"redis_queue": 11000,
|
"redis_queue": 11000,
|
||||||
"redis_socketio": 12000,
|
"redis_socketio": 12000,
|
||||||
"redis_cache": 13000
|
"redis_cache": 13000
|
||||||
|
@ -40,6 +40,7 @@ class TestBenchInit(unittest.TestCase):
|
|||||||
self.assert_common_site_config("test-bench-1", {
|
self.assert_common_site_config("test-bench-1", {
|
||||||
"webserver_port": 8000,
|
"webserver_port": 8000,
|
||||||
"socketio_port": 9000,
|
"socketio_port": 9000,
|
||||||
|
"file_watcher_port": 6787,
|
||||||
"redis_queue": "redis://localhost:11000",
|
"redis_queue": "redis://localhost:11000",
|
||||||
"redis_socketio": "redis://localhost:12000",
|
"redis_socketio": "redis://localhost:12000",
|
||||||
"redis_cache": "redis://localhost:13000"
|
"redis_cache": "redis://localhost:13000"
|
||||||
@ -51,6 +52,7 @@ class TestBenchInit(unittest.TestCase):
|
|||||||
self.assert_common_site_config("test-bench-2", {
|
self.assert_common_site_config("test-bench-2", {
|
||||||
"webserver_port": 8001,
|
"webserver_port": 8001,
|
||||||
"socketio_port": 9001,
|
"socketio_port": 9001,
|
||||||
|
"file_watcher_port": 6788,
|
||||||
"redis_queue": "redis://localhost:11001",
|
"redis_queue": "redis://localhost:11001",
|
||||||
"redis_socketio": "redis://localhost:12001",
|
"redis_socketio": "redis://localhost:12001",
|
||||||
"redis_cache": "redis://localhost:13001"
|
"redis_cache": "redis://localhost:13001"
|
||||||
@ -210,7 +212,7 @@ class TestBenchInit(unittest.TestCase):
|
|||||||
self.assert_exists(python_path, "site-packages", "pip")
|
self.assert_exists(python_path, "site-packages", "pip")
|
||||||
|
|
||||||
site_packages = os.listdir(os.path.join(python_path, "site-packages"))
|
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):
|
def assert_config(self, bench_name):
|
||||||
for config, search_key in (
|
for config, search_key in (
|
||||||
|
@ -10,14 +10,24 @@
|
|||||||
file:
|
file:
|
||||||
path: '/home/{{ frappe_user }}'
|
path: '/home/{{ frappe_user }}'
|
||||||
mode: 'o+rx'
|
mode: 'o+rx'
|
||||||
|
owner: '{{ frappe_user }}'
|
||||||
|
group: '{{ frappe_user }}'
|
||||||
|
recurse: yes
|
||||||
when: ansible_distribution == 'Ubuntu' or ansible_distribution == 'CentOS' or ansible_distribution == 'Debian'
|
when: ansible_distribution == 'Ubuntu' or ansible_distribution == 'CentOS' or ansible_distribution == 'Debian'
|
||||||
|
|
||||||
- name: Set home folder perms
|
- name: Set home folder perms
|
||||||
file:
|
file:
|
||||||
path: '/Users/{{ frappe_user }}'
|
path: '/Users/{{ frappe_user }}'
|
||||||
mode: 'o+rx'
|
mode: 'o+rx'
|
||||||
|
owner: '{{ frappe_user }}'
|
||||||
|
group: '{{ frappe_user }}'
|
||||||
|
recurse: yes
|
||||||
when: ansible_distribution == 'MacOSX'
|
when: ansible_distribution == 'MacOSX'
|
||||||
|
|
||||||
- name: Set /tmp/.bench folder perms
|
- 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'
|
when: ansible_distribution == 'Ubuntu' or ansible_distribution == 'CentOS' or ansible_distribution == 'Debian'
|
@ -18,6 +18,12 @@
|
|||||||
become: yes
|
become: yes
|
||||||
become_user: root
|
become_user: root
|
||||||
|
|
||||||
|
- name: Overwrite bench if required
|
||||||
|
file:
|
||||||
|
state: absent
|
||||||
|
path: "{{ bench_path }}"
|
||||||
|
when: overwrite
|
||||||
|
|
||||||
- name: Check whether bench exists
|
- name: Check whether bench exists
|
||||||
stat: path="{{ bench_path }}"
|
stat: path="{{ bench_path }}"
|
||||||
register: bench_stat
|
register: bench_stat
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
- name: download wkthmltox linux
|
- 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
|
- name: Creates directory
|
||||||
file: path=/tmp/wkhtmltox state=directory
|
file: path=/tmp/wkhtmltox state=directory
|
||||||
|
@ -335,6 +335,10 @@ def parse_commandline_args():
|
|||||||
parser.add_argument('--without-bench-setup', dest='without_bench_setup', action='store_true', default=False,
|
parser.add_argument('--without-bench-setup', dest='without_bench_setup', action='store_true', default=False,
|
||||||
help=argparse.SUPPRESS)
|
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()
|
args = parser.parse_args()
|
||||||
|
|
||||||
return args
|
return args
|
||||||
|
Loading…
Reference in New Issue
Block a user