Updated jenkins flavour
- Install list of plugins - Use an http service as proxy on port 80 - Only nginx for now
This commit is contained in:
parent
5efe4f983f
commit
fcf68d1c18
@ -1,10 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
set -o xtrace
|
|
||||||
|
|
||||||
# jenkins installs into /var/lib/jenkins which is rather restrictive.
|
|
||||||
mv /var/lib/jenkins /mnt/
|
|
||||||
ln -s /mnt/jenkins /var/lib/jenkins
|
|
||||||
|
|
||||||
|
|
13
flavours/jenkins/install.d/11-jenkins-plugins
Executable file
13
flavours/jenkins/install.d/11-jenkins-plugins
Executable file
@ -0,0 +1,13 @@
|
|||||||
|
B11;rgb:0000/0000/0000#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
set -o xtrace
|
||||||
|
|
||||||
|
source $(dirname $0)/defaults
|
||||||
|
|
||||||
|
if [ -n "${JENKINS_PLUGINS}" ];then
|
||||||
|
for plugin in ${JENKINS_PLUGINS//,/ }; then
|
||||||
|
wget -q http://updates.jenkins-ci.org/latest/${plugin}.hpi -O /var/lib/jenkins/plugins/${plugin}.hpi
|
||||||
|
done
|
||||||
|
chown jenkins:nogroup /var/lib/jenkins/plugins/*
|
||||||
|
fi
|
18
flavours/jenkins/install.d/20-httpproxy
Executable file
18
flavours/jenkins/install.d/20-httpproxy
Executable file
@ -0,0 +1,18 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
set -o xtrace
|
||||||
|
|
||||||
|
source $(dirname $0)/defaults
|
||||||
|
|
||||||
|
if [ "$HTTP_PROXY" != "true" ]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# ToDo: Only nginx available for now
|
||||||
|
apt-get install -y nginx
|
||||||
|
|
||||||
|
cp $(dirname $0)/httpproxy.jenkins /etc/nginx/sites-available/
|
||||||
|
sed -i 's/server_name ci.yourcompany.com;/server_name ${SERVER_NAME};/' /etc/nginx/sites-available/httpproxy.jenkins
|
||||||
|
ln -s /etc/nginx/sites-available/httpproxy.jenkins /etc/nginx/sites-enabled/
|
||||||
|
rm /etc/nginx/sites-enabled/default
|
9
flavours/jenkins/install.d/defaults
Normal file
9
flavours/jenkins/install.d/defaults
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
set -e
|
||||||
|
|
||||||
|
#Use an httpd service to run on port 80
|
||||||
|
#HTTP_PROXY="true"
|
||||||
|
SERVER_NAME="ci.yourcompany.com"
|
||||||
|
|
||||||
|
#List of plugins to install, comma separated list
|
||||||
|
#full list of plugins available at: http://updates.jenkins-ci.org/download/plugins/
|
||||||
|
#JENKINS_PLUGINS="github-oauth,ircbot,debian-package-builder"
|
20
flavours/jenkins/install.d/httpproxy.jenkins
Normal file
20
flavours/jenkins/install.d/httpproxy.jenkins
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
upstream jenkins_server {
|
||||||
|
server 127.0.0.1:8080 fail_timeout=0;
|
||||||
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
listen [::]:80 default ipv6only=on;
|
||||||
|
server_name ci.yourcompany.com;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header Host $http_host;
|
||||||
|
proxy_redirect off;
|
||||||
|
|
||||||
|
if (!-f $request_filename) {
|
||||||
|
proxy_pass http://jenkins_server;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user