diff --git a/flavours/jenkins/install.d/11-jenkins-plugins b/flavours/jenkins/install.d/11-jenkins-plugins index 5665533b..754103af 100755 --- a/flavours/jenkins/install.d/11-jenkins-plugins +++ b/flavours/jenkins/install.d/11-jenkins-plugins @@ -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/* diff --git a/flavours/jenkins/install.d/20-httpproxy b/flavours/jenkins/install.d/20-httpproxy deleted file mode 100755 index 4c5e3fb2..00000000 --- a/flavours/jenkins/install.d/20-httpproxy +++ /dev/null @@ -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 diff --git a/flavours/jenkins/install.d/defaults b/flavours/jenkins/install.d/defaults index 64396a84..cc9be69f 100644 --- a/flavours/jenkins/install.d/defaults +++ b/flavours/jenkins/install.d/defaults @@ -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" diff --git a/flavours/jenkins/install.d/httpproxy.jenkins b/flavours/jenkins/install.d/httpproxy.jenkins deleted file mode 100644 index 674425cc..00000000 --- a/flavours/jenkins/install.d/httpproxy.jenkins +++ /dev/null @@ -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; - } - } -} diff --git a/lib/img-functions b/lib/img-functions index 2fb536b2..05faad87 100644 --- a/lib/img-functions +++ b/lib/img-functions @@ -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 diff --git a/sudoers.d/img-build-sudoers b/sudoers.d/img-build-sudoers index 18bbc051..25393eb5 100644 --- a/sudoers.d/img-build-sudoers +++ b/sudoers.d/img-build-sudoers @@ -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 *