diff --git a/bench/patches/patches.txt b/bench/patches/patches.txt index 66d36b87..440b9f3b 100644 --- a/bench/patches/patches.txt +++ b/bench/patches/patches.txt @@ -1,3 +1,4 @@ bench.patches.v3.deprecate_old_config bench.patches.v3.celery_to_rq bench.patches.v3.redis_bind_ip +bench.patches.v4.update_node diff --git a/bench/patches/v4/__init__.py b/bench/patches/v4/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/bench/patches/v4/update_node.py b/bench/patches/v4/update_node.py new file mode 100644 index 00000000..e39e72ab --- /dev/null +++ b/bench/patches/v4/update_node.py @@ -0,0 +1,12 @@ +import click, subprocess, sys +from semantic_version import Version + +def execute(bench_path): + expected_node_ver = Version('5.0.0') + + result = subprocess.check_output(['node', '-v']) + node_ver = Version(result.rstrip('\n').lstrip('v')) + + if node_ver < expected_node_ver: + click.echo('\nPlease update node version to 5.x before running the "bench update"\n\n') + sys.exit(1) diff --git a/playbooks/develop/centos.yml b/playbooks/develop/centos.yml index 6b2158b6..357b9947 100644 --- a/playbooks/develop/centos.yml +++ b/playbooks/develop/centos.yml @@ -19,8 +19,6 @@ with_items: # basic installs - redis - - nodejs - - npm # for mariadb - mysql-devel @@ -45,6 +43,22 @@ become: yes become_user: root + - name: Add repo nodejs 5 + yum: + name: https://rpm.nodesource.com/pub_5.x/el/7/x86_64/nodesource-release-el7-1.noarch.rpm + state: present + update_cache: yes + become: yes + become_user: root + + - name: Install nodejs v5 + yum: name={{ item }} state=present + with_items: + - nodejs + - npm + become: yes + become_user: root + # install MariaDB - include: includes/mariadb_centos.yml diff --git a/playbooks/develop/ubuntu.yml b/playbooks/develop/ubuntu.yml index c930062f..6ca2572f 100644 --- a/playbooks/develop/ubuntu.yml +++ b/playbooks/develop/ubuntu.yml @@ -16,8 +16,6 @@ # basic installs - build-essential - redis-server - - nodejs - - npm # for mariadb - software-properties-common @@ -59,6 +57,21 @@ become: yes become_user: root + - name: Add nodejs v5 repo + shell: 'curl -sL https://deb.nodesource.com/setup_5.x' + args: + executable: /bin/bash + become: yes + become_user: root + + - name: Update and Install Node v5 + apt: name={{ item }} state=present update_cache=yes force=yes + with_items: + - nodejs + - npm + become: yes + become_user: root + # install MariaDB - include: includes/mariadb_ubuntu.yml