Skip to content

Commit 9d96442

Browse files
committed
Merge pull request #1704 from mboersma/test-scripts-node-setup
feat(tests): add CI node setup script
2 parents 42996b1 + 3b7edd7 commit 9d96442

3 files changed

Lines changed: 51 additions & 1 deletion

File tree

tests/bin/destroy-all-vagrants.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ VMS=$(vagrant global-status | grep deis | awk '{ print $5 }')
88
for dir in $VMS; do
99
cd $dir && vagrant destroy --force
1010
done
11+
rm -rf $HOME/VirtualBox\ VMs/deis*

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"

tests/bin/test-integration.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# Preps a test environment and runs `make test-integration` with single-node vagrant.
44

55
echo Testing ${DEIS_TEST_APP?}...
6+
THIS_DIR=$(cd $(dirname $0); pwd) # absolute path
67

78
# Environment reset and configuration
89
rm -rf ~/.deis ~/.fleetctl ~/.ssh/known_hosts
@@ -13,7 +14,7 @@ cd ${GOPATH?}/src/github.com/deis/deis
1314
rm -rf tests/example-*
1415

1516
# Vagrant provisioning
16-
tests/bin/halt-all-vagrant.sh
17+
$THIS_DIR/halt-all-vagrants.sh
1718
vagrant destroy --force
1819
vagrant up --provider virtualbox --provision
1920

0 commit comments

Comments
 (0)