2
0
mirror of https://github.com/frappe/bench.git synced 2024-11-11 15:51:03 +00:00

Added macos support for version check

This commit is contained in:
Valmik Jangla 2016-08-02 11:58:28 +05:30
parent 9811ad24d2
commit d23d7489d7
4 changed files with 25 additions and 20 deletions

View File

@ -90,6 +90,6 @@ def renew_certs():
'Do you want to continue?',
abort=True)
service('nginx', 'start')
exec_cmd("{path} renew".format(path=get_certbot_path()))
service('nginx', 'stop')
exec_cmd("{path} renew".format(path=get_certbot_path()))
service('nginx', 'start')

View File

@ -74,7 +74,7 @@
# setup frappe-bench
- include: includes/setup_bench.yml
when: not run_travis and without_bench_setup
when: not run_travis and not without_bench_setup
# setup development environment
- include: includes/setup_dev_env.yml

View File

@ -74,20 +74,20 @@
become: yes
become_user: root
- name: Add nodejs v5 repo
- name: Get nodejs 6.x bash script
get_url:
url: 'https://deb.nodesource.com/setup_5.x'
dest: '/tmp/setup_5.x'
url: 'https://deb.nodesource.com/setup_6.x'
dest: '/tmp/setup_6.x'
mode: 0644
become: yes
become_user: root
- name: Install setup_5.x
command: /bin/bash /tmp/setup_5.x
- name: Run nodejs bash script
command: /bin/bash /tmp/setup_6.x
become: yes
become_user: root
- name: Update and Install Node v5
- name: Install nodejs 6.x
apt:
name: nodejs
state: present
@ -95,7 +95,7 @@
force: yes
become: yes
become_user: root
# install MariaDB
- include: includes/mariadb_debian.yml

View File

@ -114,23 +114,28 @@ def install_bench(args):
shutil.rmtree(tmp_bench_repo)
def check_distribution_compatibility():
supported_dists = {'ubuntu': [14, 15, 16], 'debian': [7, 8], 'centos': [7]}
dist_name, dist_version = get_distribution_info()
for dist, versions in supported_dists.iteritems():
if dist_name == dist:
if dist_version in versions:
return
supported_dists = {'ubuntu': [14, 15, 16], 'debian': [7, 8],
'centos': [7], 'macos': [10.9, 10.10, 10.11, 10.12]}
print "We currently do not support {0} {1}. Aborting installation!".format(dist_name, dist_version)
dist_name, dist_version = get_distribution_info()
if dist_name in supported_dists:
if float(dist_version) in supported_dists[dist_name]:
return
print "Sorry, the installer doesn't support {0} {1}. Aborting installation!".format(dist_name, dist_version)
if dist_name in supported_dists:
print "Install on {0} {1} instead".format(dist_name, supported_dists[dist_name][-1])
sys.exit(1)
def get_distribution_info():
current_dist = platform.dist()
# return distribution name and major version
return current_dist[0].lower(), int(float(current_dist[1]))
if platform.system() == "Linux":
current_dist = platform.dist()
return current_dist[0].lower(), current_dist[1].rsplit('.')[0]
elif platform.system() == "Darwin":
current_dist = platform.mac_ver()
return "macos", current_dist[0].rsplit('.', 1)[0]
def install_python27():
version = (sys.version_info[0], sys.version_info[1])