Jenkins image fixed

- Removed http_proxy option
- Added sudoers entry to cp first-bot.d
- Fixed typo on 11-jenkins-plugins
- Restored trap exit on run-parts
This commit is contained in:
Ghe Rivero 2012-11-27 18:37:57 +01:00
parent f48fa9e369
commit 38dc7680c9
6 changed files with 2 additions and 45 deletions

View File

@ -6,7 +6,7 @@ set -o xtrace
source $(dirname $0)/defaults
if [ -n "${JENKINS_PLUGINS}" ];then
for plugin in ${JENKINS_PLUGINS//,/ }; then
for plugin in ${JENKINS_PLUGINS//,/ }; do
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/*

View File

@ -1,18 +0,0 @@
#!/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

View File

@ -1,9 +1,5 @@
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"

View File

@ -1,20 +0,0 @@
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;
}
}
}

View File

@ -116,9 +116,7 @@ function run_d_in_target() {
sudo mkdir $TMP_MOUNT_PATH/tmp/in_target.d
sudo mount --bind ${TMP_HOOKS_PATH} $TMP_MOUNT_PATH/tmp/in_target.d
sudo mount -o remount,ro,bind ${TMP_HOOKS_PATH} $TMP_MOUNT_PATH/tmp/in_target.d
trap - EXIT
run_in_target run-parts -v /tmp/in_target.d/$1.d
trap cleanup EXIT
sudo umount -f $TMP_MOUNT_PATH/tmp/in_target.d
sudo rmdir $TMP_MOUNT_PATH/tmp/in_target.d
fi

View File

@ -40,4 +40,5 @@ ALL ALL=(root) NOPASSWD: /usr/bin/qemu-nbd -c /dev/nbd0 --cache=writeback /tmp/*
ALL ALL=(root) NOPASSWD: /usr/bin/qemu-nbd -d /dev/nbd0
ALL ALL=(root) NOPASSWD: /usr/bin/touch /tmp/*/mnt/*
ALL ALL=(root) NOPASSWD: /usr/bin/unlink /tmp/*/mnt/*
ALL ALL=(root) NOPASSWD: /bin/cp -t /tmp/*/mnt/etc/ -a /tmp/*/hooks/first-boot.d
ALL ALL=(root) SETENV: NOPASSWD: /usr/sbin/chroot /tmp/*/mnt *