summaryrefslogtreecommitdiff
path: root/continuous_integration_debian_wheezy_setup.mdwn
blob: 9127b32db9529c03e2786ec8b765298c4c7d7173 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
[[!meta title="Continuous Integration Debian Wheezy Setup"]]
[[!meta author="Kyllikki"]]
[[!meta date="2014-12-20T11:46:57Z"]]


[[!toc]]

Debian wheezy (7.0) OS install
------------------------------

Install minimal system from netinst CD (attached when VDS is created on
phoenix) Config options:

-   In the "role" selection select "ssh server" and "system utilities"
    only.
-   The whole disc default partitioning is fine
-   The base user the install insists on creating should be the netsurf
    user.
-   Boot loader in MBR

Once installed:

-   install sudo package and add netsurf user to sudo group
-   edit /etc/inittab comment pty 3 through 6 and uncomment serial T0

Packaged Setup for Debian wheezy (7.0)
--------------------------------------

on master jenkins use "manage nodes" to create new node. Ensure "remote
fs root" is set to /var/lib/jenkins add variable JENKINS\_HOME set to
/var/lib/jenkins

As superuser:

-   create jenkins user

`adduser --system --group --home /var/lib/jenkins/ --disabled-login jenkins`

-   Add CI server repo to slave apt sources

`echo "deb `[`http://ci.netsurf-browser.org/debian/`](http://ci.netsurf-browser.org/debian/)` wheezy/amd64/" >> /etc/apt/sources.list.d/netsurf-browser.list`

-   update repos

`apt-get update`

-   install ns-ci-slave package. accept the large package list and the
    unsigned package install for gcovr and ns-ci-slave

`apt-get install ns-ci-slave`

-   edit /etc/default/ns-ci-slave to set the correct url and secret
    parameters
-   If toolchains are to be built on the node ensure /opt is setup
    correctly

`mkdir -p /opt/netsurf`  
`chown jenkins:jenkins /opt/netsurf`

-   become jenkins user

`su -s/bin/bash - jenkins`

-   create ssh keypair (accept defaults - no password)

`ssh-keygen -t rsa -C "netsurf@cislave10.netsurf-browser.org"`

-   copy .ssh/id\_rsa.pub from slave to jenkins master node and append
    to /home/netsurf/.ssh/authorized\_keys

`scp /home/jenkins/.ssh/id_rsa.pub netsurf@ci.netsurf-browser.org:cislave10_id_rsa.pub`

-   exit jenkins user shell
-   start slave daemon

`/etc/init.d/ns-ci-slave start`

Manual Setup of Debian wheezy (7.0)
-----------------------------------

### required packages

use apt to install all these. The Netsurf repository has the necessary
updated packages in it and can be accessed by doing the following:

-   Add CI server repo to slave apt sources

`echo "deb `[`http://ci.netsurf-browser.org/builds/debian/`](http://ci.netsurf-browser.org/builds/debian/)` wheezy/amd64/" >> /etc/apt/sources.list`

-   update repos

`apt-get update`

`openjdk-7-jre-headless `  
`screen `  
`build-essential`  
`ccache`  
`clang`  
`git`  
`pkg-config`  
`check`  
`doxygen`  
`libjson0-dev (from our repo - needs bugfixes `[`http://ci.netsurf-browser.org/builds/debian/`](http://ci.netsurf-browser.org/builds/debian/)`)`  
`libexpat1-dev`  
`libxml-perl`  
`libxml-xpath-perl`  
`lcov`  
`gcovr (from our repo)`  
`gperf`  
`flex`  
`bison`  
`libpng-dev`  
`libjpeg-dev`  
`libmozjs185-dev`  
`libglib2.0-dev`  
`libcurl4-openssl-dev`  
`liblcms1-dev`  
`libxml2-dev`  
`librsvg2-dev`  
`libmng-dev`  
`libgtk2.0-dev`  
`libmozjs-dev`

### config

-   on master jenkins use "manage nodes" to create new node. Ensure
    "remote fs root" is set to /home/netsurf/jenkins
-   create netsurf user
-   as netsurf user:
    -   wget <http://ci.netsurf-browser.org/jenkins/jnlpJars/slave.jar>
    -   run screen
    -   create jenkins-slave.sh

`#!/bin/bash`  
  
`java -Djava.awt.headless=true -jar slave.jar -jnlpUrl `[`http://ci.netsurf-browser.org/jenkins/computer/chimera/slave-agent.jnlp`](http://ci.netsurf-browser.org/jenkins/computer/chimera/slave-agent.jnlp)` -secret 0123456789abcdef01234567890abcdef`

-   -   run jenkins-slave.sh
    -   create new screen tab
    -   create ssh keypair (accept defaults - no password)

`ssh-keygen -t rsa -C "netsurf@cislave0.netsurf-browser.org"`

-   -   copy .ssh/id\_rsa.pub from slave to jenkins master node and
        append to /home/netsurf/.ssh/authorized\_keys

`scp ci.netsurf-browser.org:.ssh/id_rsa.pub .id_rsa.pub`  
`cat id_rsa.pub >> .ssh/authorized_keys`

-   -   copy .ssh/id\_rsa.pub from master node to slave and append to
        /home/netsurf/.ssh/authorized\_keys
    -   create reverse-ssh.sh (change tunnel port number!)

`#!/bin/sh`  
  
`ssh -R 22224:localhost:22 netsurf@ci.netsurf-browser.org 'bash -c "while true; do echo .; sleep 60; done"'`

-   -   run reverse-ssh.sh
    -   on the master create a shell script to use the ssh tunnel
        connection, thus firewalls etc are moot as long as the slave can
        connect to the master

`ssh netsurf@localhost -p 22223`