Skip to content

Commit

Permalink
ansible: prepare jenkins-workspace machines for linting duty
Browse files Browse the repository at this point in the history
Ref: #2001
  • Loading branch information
rvagg committed Oct 30, 2019
1 parent 03b9633 commit ff6f5b1
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 34 deletions.
2 changes: 1 addition & 1 deletion ansible/inventory.yml
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ hosts:
ubuntu1604-arm64-2: {ip: 147.75.74.174}
# when adding, removing or changing the IPs below,
# remember to update Jenkins worker IP whitelist in github-bot
ubuntu1604-x64-1: {ip: 147.75.70.237, alias: jenkins-workspace-1}
ubuntu1604-x64-1: {ip: 147.75.70.41, alias: jenkins-workspace-1}
ubuntu1604-x64-2: {ip: 147.75.73.189, alias: jenkins-workspace-2}

- nearform:
Expand Down
35 changes: 3 additions & 32 deletions ansible/playbooks/jenkins/worker/create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,42 +68,13 @@
roles:
- linux-perf

#
# Set up linter servers
#

- hosts:
- test-joyent-freebsd10-x64-2
- test-rackspace-freebsd10-x64-1

tasks:
- name: install lint-related packages
package:
name: "{{ package }}"
state: present
loop_control:
loop_var: package
with_items: [ "node", "npm" ]

- name: install core-validate-commit
npm:
name: "core-validate-commit"
global: yes
state: present
production: yes

- name: periodically update core-validate-commit
cron:
special_time: daily
# ksh does different stdout/err routing
job: "npm update -g core-validate-commit > & /dev/null"

# Ensure node is not installed anywhere but the linter servers
- hosts:
- test
- release
- "!test-joyent-freebsd10-x64-2"
- "!test-rackspace-freebsd10-x64-1"
- "!test-packetnet-ubuntu1604-x64-1"
- "!test-packetnet-ubuntu1604-x64-2"
- "!test-softlayer-ubuntu1604-x64-1"
tasks:
- name: remove node and npm packages
when: not os|startswith("win") and not os|startswith("zos")
Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/baselayout/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ packages: {
],

ubuntu: [
'ccache,g++,gcc,g++-6,gcc-6,git,libfontconfig1,sudo',
'ccache,g++,gcc,g++-6,gcc-6,git,libfontconfig1,sudo,python3-pip',
],

ubuntu1404: [
Expand Down
28 changes: 28 additions & 0 deletions ansible/roles/jenkins-workspace/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,31 @@
command: "git config gc.auto 0"
args:
chdir: "~binary_tmp/binary_tmp.git/"

- name: Add nodesource signing key
apt_key:
url: https://deb.nodesource.com/gpgkey/nodesource.gpg.key
state: present

- name: Add nodesource repo
apt_repository:
repo: deb https://deb.nodesource.com/node_12.x xenial main
state: present

- name: Install node
package:
name: nodejs
state: present

- name: Upgrade pip2
pip:
name: pip
executable: pip2
state: latest

- name: Upgrade pip3
pip:
name: pip
executable: pip3
state: latest

0 comments on commit ff6f5b1

Please sign in to comment.