Skip to content

Commit 9bc583c

Browse files
committed
feat(tests): add CI node setup script
Adds a new shell script with the incantations needed to get an Ubuntu 14.04 worker node connected to our Jenkins CI server.
1 parent 42996b1 commit 9bc583c

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

tests/bin/setup-node.sh

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/bin/bash
2+
#
3+
# Preps a Ubuntu 14.04 box with requirements to run as a Jenkins node to http://ci.deis.io/
4+
# Should be run as root.
5+
6+
# install docker 1.1.2
7+
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
8+
sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
9+
apt-get update
10+
apt-get install -yq lxc-docker-1.1.2
11+
12+
# install java
13+
apt-get install -yq java-common openjdk-7-jre-headless
14+
15+
# install virtualbox 4.3.14
16+
apt-get install -yq build-essential libgl1 libgl1-mesa-glx libpython2.7 libqt4-network libqt4-opengl \
17+
libqtcore4 libqtgui4 libsdl1.2debian libvpx1 libxcursor1
18+
wget http://download.virtualbox.org/virtualbox/4.3.14/virtualbox-4.3_4.3.14-95030~Ubuntu~raring_amd64.deb
19+
dpkg -i virtualbox-4.3_4.3.14-95030~Ubuntu~raring_amd64.deb && \
20+
rm virtualbox-4.3_4.3.14-95030~Ubuntu~raring_amd64.deb
21+
22+
# install vagrant
23+
wget https://dl.bintray.com/mitchellh/vagrant/vagrant_1.6.3_x86_64.deb
24+
dpkg -i vagrant_1.6.3_x86_64.deb && rm vagrant_1.6.3_x86_64.deb
25+
26+
# install go
27+
wget -qO- https://storage.googleapis.com/golang/go1.3.1.linux-amd64.tar.gz | tar -C /usr/local -xz
28+
echo 'export PATH=$PATH:/usr/local/go/bin' >> /etc/profile
29+
30+
# install test suite requirements
31+
apt-get install -yq python-dev libpq-dev libyaml-dev git postgresql postgresql-client
32+
RUN wget -qO- https://raw.githubusercontent.com/pypa/pip/1.5.5/contrib/get-pip.py | python -
33+
pip install virtualenv
34+
35+
# create jenkins user and install node bootstrap script
36+
useradd -G docker,vboxusers -s /bin/bash -m jenkins
37+
mkdir -p /home/jenkins/bin
38+
wget -x -O /home/jenkins/bin/start-node.sh \
39+
https://raw.githubusercontent.com/deis/deis/master/tests/bin/start-node.sh
40+
chmod +x /home/jenkins/bin/start-node.sh
41+
chown -R jenkins:jenkins /home/jenkins/bin
42+
43+
# now the jenkins user has to export some envvars to start as a node
44+
echo "Remaining setup:"
45+
echo " 1. Log in as the jenkins user (sudo -i -u jenkins)"
46+
echo " 2. Visit the nodes admin interface at http://ci.deis.io/ to find the command line for this node"
47+
echo " 3. Export the NODE_NAME and NODE_SECRET environment variables defined there to your shell"
48+
echo " 4. Run bin/start-node.sh to connect to Jenkins and start handling jobs"

0 commit comments

Comments
 (0)