From: Konrad Rosenbaum Date: Wed, 11 Jan 2017 06:41:05 +0000 (+0100) Subject: add docker definitions X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=15e255175d19850282f71a9ec2d9d45cda0b7438;p=web%2Fkonrad%2Fsmoke.git add docker definitions Change-Id: I31d7ecca42065b8a6d8a042fc06645ffd6b5680e --- diff --git a/tests/docker/README b/tests/docker/README new file mode 100644 index 0000000..3fab669 --- /dev/null +++ b/tests/docker/README @@ -0,0 +1,47 @@ +README for Docker-Test Setups +=============================== + +This directory contains docker configurations that are used with Jenkins to +build and test MagicSmoke. + +There are currently these images: + + * qtenv: for building and testing the client + * php5: for building and testing the server on PHP5 + * php7: for building and testing the server on PHP7 + +All images contain a jenkins user with UID 12001 and a /jenkins home directory. +In this directory is a start.sh script that downloads + +Building the Client and Server +------------------------------- + +Node Setup: + This needs a node based on the qtenv image that receives its Qt from an + outside volume. + + Assuming you have Qt 5.7 installed from the standard binary installer for Qt + for Linux, then you should have a full installation in /home/me/Qt/5.7/gcc_64. + + Setup your node like this: + # of executors: 1 + Remote root directory: /jenkins/jobs + Launch Method: Launch agent via execution of a command on master + Launch command: docker run --rm -v /home/me:/home/me -i magicsmoke-qtenv /jenkins/start.sh http://192.168.0.1:8080 + => replace /home/me with your correct home directory + => replace 192.168.0.1:8080 with the base URL of the jenkins server (the + script will add /jnlpJars/slave.jar to download slave.jar) + Availability: Take this agent online when in demand, and offline when idle + +Build Job: + Setup the job for an appropriate trigger and source repository. Usually + you will use some kind of GIT trigger. Make sure the repository is checked + out recursively, including all submodules. + + Make sure you have qmake in your path. Build one of the packaging targets. + + E.g.: + PATH=/home/me/Qt/5.7/gcc_64/bin:$PATH + git clean -dfx + git submodules foreach 'git clean -dfx' + make tgz diff --git a/tests/docker/php5/Dockerfile b/tests/docker/php5/Dockerfile new file mode 100644 index 0000000..2ed7d5c --- /dev/null +++ b/tests/docker/php5/Dockerfile @@ -0,0 +1,8 @@ +FROM debian:jessie +ENV DEBIAN_FRONTEND=noninteractive +RUN apt-get update +RUN apt-get install -y openjdk-7-jre-headless wget git +RUN useradd -d /jenkins -m -s /bin/bash -u 12001 -U jenkins +COPY start.sh /jenkins +RUN apt-get install -y mysql-server mysql-client postgresql-9.4 postgresql-client-9.4 apache2 libapache2-mod-php5 php5-mcrypt php5-mysql php5-pgsql phpunit +CMD /bin/bash diff --git a/tests/docker/php5/start.sh b/tests/docker/php5/start.sh new file mode 100755 index 0000000..f4c9cd5 --- /dev/null +++ b/tests/docker/php5/start.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +#This script runs inside the container to start the Jenkins Slave. + +### start Apache +apachectl start + +### start MySQL +/etc/init.d/mysql start +#craete smoke user and give it full admin rights +mysql -e "CREATE USER smoke@localhost" +mysql -e 'GRANT ALL PRIVILEGES ON *.* TO smoke' + +### start Postgres +# make sure PG allows use without password/auth +cat >/etc/postgresql/*/main/pg_hba.conf </etc/postgresql/*/main/pg_hba.conf <