Make a primitive jenkins image.

This commit is contained in:
Robert Collins 2012-11-22 17:58:07 +13:00
parent d935fc0e07
commit 5efe4f983f
6 changed files with 62 additions and 9 deletions

View File

@ -0,0 +1,25 @@
Provisions a jenkins for doing tests of openstack cloud images
==============================================================
After deploying the image, jenkins should be available on port 8080.
*The following is fiction*
To use this, add a new application at
`https://github.com/organizations/$ORGANISATION/settings/applications` and grab
the client id and secret it provides.
Config options
--------------
XXX: These should be passed in via cloud-init or salt, not on image build. For
now, export before building the image.
* export `GITHUB_ORGANISATION` to set the which organisation to look for github
committers from.
* export `GITHUB_ADMINS` to set a list of github users to be jenkins admins.
* export `GITHUB_CLIENT_ID` to set the github OAuth client id.
* export `GITHUB_SECRET` to set the github OAuth secret.

View File

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

View File

@ -0,0 +1,10 @@
#!/bin/bash
set -e
set -o xtrace
apt-get -y install jenkins
# jenkins installs into /var/lib/jenkins which is rather restrictive.
mv /var/lib/jenkins /mnt/
ln -s /mnt/jenkins /var/lib/jenkins

View File

@ -0,0 +1,8 @@
#!/bin/bash
# Add the Jenkins package archive
set -e
set -o xtrace
wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | apt-key add -
echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list

View File

@ -6,11 +6,9 @@ set -e
set -o xtrace
if [ -n "$http_proxy" ]; then
sudo -Hiu stack dd of=~stack/.profile oflag=append conv=notrunc << EOF
export no_proxy=192.0.2.1
export http_proxy=$http_proxy
EOF
sudo dd of=/etc/apt/apt.conf.d/61-use-http-proxy << _EOF_
Acquire::http::Proxy "$http_proxy";
_EOF_
if [ -d ~stack ]; then
echo export no_proxy=192.0.2.1 >> ~stack/.profile
echo export http_proxy=$http_proxy >> ~stack/.profile
fi
echo Acquire::http::Proxy \"$http_proxy\"; > /etc/apt/apt.conf.d/61-use-http-proxy
fi

View File

@ -5,6 +5,8 @@
set -e
if [ -e "/tmp/in_target.d/ssh-authorized-keys" ]; then
if [ -d ~stack ]; then
sudo -u stack mkdir ~stack/.ssh
sudo -Hiu stack dd of=~stack/.ssh/authorized_keys oflag=append conv=notrunc if=/tmp/in_target.d/ssh-authorized-keys
fi
fi