Skip to content

Commit

Permalink
force activate virtualenv, and properly set cpu count
Browse files Browse the repository at this point in the history
  • Loading branch information
otakup0pe committed Feb 19, 2018
1 parent 69484e2 commit 7ef5a66
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ env:
- ROLE_OPTIONS="nodejs_install_method=package"
- ROLE_OPTIONS="nodejs_install_method=binary"
install:
- pip install -U ansible urllib3
- pip install -U ansible
# Install dependencies
- ansible-galaxy install -r tests/requirements.yml
script:
- source ~/virtualenv/python2.7/bin/activate
- echo localhost > inventory

# Syntax check
Expand Down
20 changes: 13 additions & 7 deletions tasks/source.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,25 @@
src: "/tmp/node-v{{nodejs_version}}.tar.gz"
dest: "/tmp"

- name: node.js | source |Get the number of processors (Linux)
- name: node.js | source | Get the number of processors (Linux)
command: nproc
register: cpu_count
register: cpu_count_linux
when: ansible_system == 'Linux'

- name: node.js | source |Get the number of processors (Darwin)
- name: node.js | source | Get the number of processors (Darwin)
command: sysctl -n hw.ncpu
register: cpu_count
register: cpu_count_darwin
when: ansible_os_family == 'Darwin'

- name: "TEST PLEASE REMOVE"
debug:
var: cpu_count
- name: node.js | source | Set number of processors (Linux)
set_fact:
cpu_count: "{{cpu_count_linux}}"
when: ansible_system == 'Linux'

- name: node.js | source | Set number of processors (Darwin)
set_fact:
cpu_count: "{{cpu_count_darwin}}"
when: ansible_system == 'Darwin'

- name: node.js | source | Build node.js from source
shell: >
Expand Down

0 comments on commit 7ef5a66

Please sign in to comment.