-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- no need for jenkins-slave to have Docker installed as you can use t…
…he installation from the host - added image with headless Firefox installation
- Loading branch information
Showing
9 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM quintenk/jenkins-slave | ||
|
||
MAINTAINER Quinten Krijger "https://github.com/Krijger | ||
RUN apt-get -y install firefox xvfb | ||
ADD xvfb.sv.conf /etc/supervisor/conf.d/ | ||
CMD supervisord -c /etc/supervisor.conf | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Complete image to run Jenkins as a slave with headless Firefox | ||
============================================================== | ||
|
||
Installed are: | ||
- Supervisord (inherited) | ||
- Oracle Java 7 Development Kit (inherited) | ||
- Firefox | ||
- Xvfb headless display driver | ||
|
||
Run with access to Docker on the host | ||
------------------------------------- | ||
|
||
docker run | ||
-v /run/docker.sock:/run/docker.sock | ||
-v /usr/bin/docker:/usr/bin/docker | ||
[-v ${absolute path to the jenkins directory - helpful for restarts}:/var/jenkins] | ||
-e JENKINS_PORT_8080_TCP_ADDR=${host for master jenkins} | ||
[-e JENKINS_PORT_8080_TCP_PORT=${port for master jenkins, defaults to 8080}] | ||
-e SLAVE_NAME=${slave name, you name the slave when creating the node on the master jenkins} | ||
[-e JENKINS_SECRET=${secret for jenkins - if needed you can find this in the information page for the slave node (on master)}] | ||
-d quintenk/firefox-jenkins-slave | ||
|
||
or skip the two -v options if you don't need Docker from the host | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
|
||
docker build -t quintenk/firefox-jenkins-slave . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[program:xvfb] | ||
command=/bin/bash -c "Xvfb :10 -ac" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM quintenk/jdk-oracle:7 | ||
|
||
MAINTAINER Quinten Krijger "https://github.com/Krijger | ||
ADD runslave.sh /usr/local/bin/runslave | ||
RUN chmod +x /usr/local/bin/runslave | ||
ADD jenkins-slave.sv.conf /etc/supervisor/conf.d/ | ||
CMD supervisord -c /etc/supervisor.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
Complete image to run Jenkins as a slave | ||
======================================== | ||
|
||
Installed are: | ||
- Supervisord (inherited) | ||
- Oracle Java 7 Development Kit (inherited) | ||
- Firefox | ||
- Xvfb headless display driver | ||
|
||
Run with access to Docker on the host | ||
------------------------------------- | ||
|
||
docker run | ||
-v /run/docker.sock:/run/docker.sock | ||
-v /usr/bin/docker:/usr/bin/docker | ||
[-v ${absolute path to the jenkins directory - helpful for restarts}:/var/jenkins] | ||
-e JENKINS_PORT_8080_TCP_ADDR=${host for master jenkins} | ||
[-e JENKINS_PORT_8080_TCP_PORT=${port for master jenkins, defaults to 8080}] | ||
-e SLAVE_NAME=${slave name, you name the slave when creating the node on the master jenkins} | ||
[-e JENKINS_SECRET=${secret for jenkins - if needed you can find this in the information page for the slave node (on master)}] | ||
-d quintenk/jenkins-slave | ||
|
||
or skip the two -v options if you don't need Docker from the host |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
|
||
docker build -t quintenk/jenkins-slave . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[program:jenkins-slave] | ||
command=/bin/bash -c "runslave" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
set -x | ||
|
||
JENKINS_AUTHORITY=${JENKINS_PORT_8080_TCP_ADDR}:${JENKINS_PORT_8080_TCP_PORT:-8080} | ||
SLAVE_JAR_URL="http://${JENKINS_AUTHORITY}/jnlpJars/slave.jar" | ||
JNLP_URL="http://${JENKINS_AUTHORITY}/computer/${SLAVE_NAME}/slave-agent.jnlp" | ||
|
||
VAR_LIB_JENKINS="/var/lib/jenkins" | ||
SLAVE_JAR="${VAR_LIB_JENKINS}/slave.jar" | ||
|
||
if [ ! -f ${SLAVE_JAR} ] ; then | ||
mkdir -p ${VAR_LIB_JENKINS} | ||
wget --retry-connrefused -t inf ${SLAVE_JAR_URL} -O ${SLAVE_JAR} | ||
fi | ||
|
||
if [[ $JENKINS_SECRET ]] ; then | ||
java -jar ${SLAVE_JAR} -jnlpUrl ${JNLP_URL} -secret ${JENKINS_SECRET} | ||
else | ||
java -jar ${SLAVE_JAR} -jnlpUrl ${JNLP_URL} | ||
fi |