summaryrefslogtreecommitdiff
path: root/continuous_integration/fedora_25_setup.mdwn
blob: 1ac17861ac09cb585cdd4eb3a31186b731f6eaf8 (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
[[!meta title="Continuous Integration worker Fedora 25 Setup"]]
[[!meta author="Kyllikki"]]
[[!meta date="2017-05-28T12:46:14Z"]]


[[!toc]]

## Fedora 25 OS install

### amd64 VDS install from media

[[Virtual server setup|virtual_host_server]]

Run through the base install steps ensuring to create the netsurf user.


## Manual CI worker install


### required packages

to obtain required packages

   dnf install fedora-packager fedora-review java-1.8.0-openjdk-headless gcc clang git pkgconfig libcurl-devel libjpeg-devel bison flex expat-devel libpng-devel openssl-devel screen check gperf perl-HTML-Parser ccache

For gtk2 builds

    dnf install gtk2-devel

for gtk3 builds

    dnf install gtk3-devel

Development tool group using

    dnf group install 'Development Tools'


### config

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

-   ensure /opt is setup correctly to allow toolchains to be built on the node 

    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@nsciworker17.netsurf-browser.org"

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

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

-   get jenkins slave jar

    wget http://ci.netsurf-browser.org/jenkins/jnlpJars/slave.jar

-   exit jenkins user shell

-   create ns-ci-worker.service file

    [Unit]
    Description=Netsurf CI worker
    Documentation=http://wiki.netsurf-browser.org/continuous_integration/
    Requires=network.target
    After=multi-user.target
    
    [Service]
    Type=simple
    ExecStart=/bin/java -Djava.awt.headless=true -jar /var/lib/jenkins slave.jar -jnlpUrl http://ci.netsurf-browser.org/jenkins/computer/nsworker17/slave-agent.jnlp -secret 0123456789abcdef01234567890abcdef
    Restart=always
    RestartSec=60
    StartLimitInterval=0
    User=jenkins
    
    [Install]
    WantedBy=multi-user.target


-   install and start new service

    install -D -m 644 ns-ci-worker.service /usr/lib/systemd/system/ns-ci-worker.service
    systemctl daemon-reload
    systemctl start ns-ci-worker
    systemctl enable ns-ci-worker









-   create jenkins-slave.sh ensuring the secret key is correct

    #!/bin/bash
    
    

-   run screen

-   run jenkins-slave.sh

-   detach screen