Skip to content

Commit bd3f69d

Browse files
committed
added raspberry pi config
1 parent 310df1f commit bd3f69d

File tree

6 files changed

+137
-0
lines changed

6 files changed

+137
-0
lines changed

setup/ansible-inventory

+9
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,15 @@ iojs-build-freebsd101-64-1
3838
iojs-build-containers-1
3939
iojs-build-containers-2
4040

41+
[iojs-raspbian]
42+
iojs-ns-pi1-1
43+
iojs-ns-pi1-2
44+
iojs-ns-pi1p-1
45+
iojs-ns-pi2-1
46+
iojs-ns-pi2-2
47+
iojs-ns-pi2-3
48+
iojs-ns-pi2-4
49+
4150
[iojs-www]
4251
iojs-www
4352

setup/raspberry-pi/README.md

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# io.js Build Raspberry Pi Setup
2+
3+
For setting up Raspberry Pi boxes
4+
5+
```text
6+
Host iojs-ns-pi1-1
7+
HostName xx.xx.xx.xx
8+
User pi
9+
...
10+
```
11+
12+
Note that these hostnames are also used in the *ansible-inventory* file. The IP addresses will need to be updated each time the servers are reprovisioned.
13+
14+
To set up a host, run:
15+
16+
```text
17+
$ ansible-playbook -i ../ansible-inventory ansible-playbook.yaml
18+
```
19+
20+
Start-up of the Jenkins slaves is manual (for now), run:
21+
22+
```text
23+
$ ssh iojs@iojs-ns-pi1-1 ./start.sh
24+
```
25+
26+
**Users**: The ansible-vars.yaml file contains a list of users who's GitHub public keys are pulled and placed into authorized_keys for both root and iojs users. This file should be updates when new users are added to the build project who are able to help maintain the containerized builds.
+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
---
2+
- hosts: iojs-raspbian
3+
sudo: yes
4+
5+
tasks:
6+
7+
- include_vars: ansible-vars.yaml
8+
tags: vars
9+
10+
- name: General | APT Update
11+
apt: update_cache=yes
12+
tags: general
13+
14+
- name: General | APT Upgrade
15+
apt: upgrade=dist
16+
tags: general
17+
18+
- name: General | Install required packages
19+
apt: name={{ item }} update_cache=yes state=latest
20+
with_items: packages
21+
tags: general
22+
23+
- name: General | update-alternatives for gcc
24+
alternatives: name=gcc link=/usr/bin/gcc path=/usr/bin/gcc-4.8
25+
26+
- name: General | update-alternatives for cc
27+
alternatives: name=cc link=/usr/bin/cc path=/usr/bin/gcc-4.8
28+
29+
- name: General | update-alternatives for g++
30+
alternatives: name=g++ link=/usr/bin/g++ path=/usr/bin/g++-4.8
31+
32+
- name: General | update-alternatives for c++
33+
alternatives: name=c++ link=/usr/bin/c++ path=/usr/bin/g++-4.8
34+
35+
- name: General | update-alternatives for cpp
36+
alternatives: name=cpp link=/usr/bin/cpp path=/usr/bin/g++-4.8
37+
38+
- name: General | Increase file descriptor limits
39+
lineinfile: dest=/etc/security/limits.conf line="{{ item }}"
40+
with_items:
41+
- "* hard nofile 500000"
42+
- "* soft nofile 500000"
43+
- "root hard nofile 500000"
44+
- "root soft nofile 500000"
45+
tags: general
46+
47+
- name: User | Add {{ server_user }} user
48+
user: name="{{ server_user }}" shell=/bin/bash
49+
tags: user
50+
51+
- name: User | Download pubkey(s)
52+
get_url: url=https://github.com/{{ item }}.keys dest=/tmp/{{ item }}.keys
53+
delegate_to: 127.0.0.1
54+
with_items: ssh_users
55+
tags: user
56+
57+
- name: General | Create authorized_keys for {{ server_user }}
58+
authorized_key: user="{{ server_user }}" key="{{ lookup('file', '/tmp/' + item + '.keys') }}"
59+
with_items: ssh_users
60+
tags: user
61+
62+
- name: Jenkins | Download Jenkins' slave.jar to {{ server_user }}
63+
command: curl -sL https://jenkins-iojs.nodesource.com/jnlpJars/slave.jar -o /home/{{ server_user }}/slave.jar
64+
tags: jenkins
65+
66+
- name: Jenkins | Copy start.sh script
67+
copy: src=./resources/start.sh dest=/home/{{ server_user }}/start.sh owner={{ server_user }} group={{ server_user }} mode=0755
68+
tags: jenkins
69+
70+
- name: Jenkins | Copy secrets to start.sh script
71+
replace: dest=/home/{{ server_user }}/start.sh regexp="\{\{secret\}\}" replace="{{ server_secret }}"
72+
tags: jenkins
73+
74+
- name: Jenkins | Copy server ids to start.sh script
75+
replace: dest=/home/{{ server_user }}/start.sh regexp="\{\{id\}\}" replace="{{ server_id }}"
76+
tags: jenkins
77+
78+
- name: Jenkins | Copy arch to start.sh script
79+
replace: dest=/home/{{ server_user }}/start.sh regexp="\{\{server_arch\}\}" replace="{{ server_arch }}"
80+
tags: jenkins

setup/raspberry-pi/ansible-vars.yaml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
server_user: iojs
3+
ssh_users:
4+
- rvagg
5+
- wblankenship
6+
- jbergstrom
7+
packages:
8+
- openjdk-7-jre
9+
- python-all
10+
- python-software-properties
11+
- automake
12+
- libtool
13+
- curl
14+
- git
15+
- gcc-4.8
16+
- g++-4.8
17+
- ccache
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
iojs-*

setup/raspberry-pi/resources/start.sh

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
3+
rm -f nohup.out
4+
ARCH={{server_arch}} DESTCPU=arm PATH=/usr/lib/ccache/:$PATH JOBS=1 NODE_COMMON_PIPE=/home/iojs/test.pipe OSTYPE=linux-gnu nohup java -jar slave.jar -jnlpUrl https://jenkins-iojs.nodesource.com/computer/iojs-nodesource-raspbian-wheezy-{{id}}/slave-agent.jnlp -secret {{secret}} &

0 commit comments

Comments
 (0)