Make a primitive jenkins image.
This commit is contained in:
parent
d935fc0e07
commit
5efe4f983f
25
flavours/jenkins/README.md
Normal file
25
flavours/jenkins/README.md
Normal 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.
|
10
flavours/jenkins/first-boot.d/10-jenkins
Executable file
10
flavours/jenkins/first-boot.d/10-jenkins
Executable 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
|
||||||
|
|
||||||
|
|
10
flavours/jenkins/install.d/10-jenkins
Executable file
10
flavours/jenkins/install.d/10-jenkins
Executable 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
|
8
flavours/jenkins/pre-install.d/10-jenkins
Executable file
8
flavours/jenkins/pre-install.d/10-jenkins
Executable 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
|
@ -6,11 +6,9 @@ set -e
|
|||||||
set -o xtrace
|
set -o xtrace
|
||||||
|
|
||||||
if [ -n "$http_proxy" ]; then
|
if [ -n "$http_proxy" ]; then
|
||||||
sudo -Hiu stack dd of=~stack/.profile oflag=append conv=notrunc << EOF
|
if [ -d ~stack ]; then
|
||||||
export no_proxy=192.0.2.1
|
echo export no_proxy=192.0.2.1 >> ~stack/.profile
|
||||||
export http_proxy=$http_proxy
|
echo export http_proxy=$http_proxy >> ~stack/.profile
|
||||||
EOF
|
fi
|
||||||
sudo dd of=/etc/apt/apt.conf.d/61-use-http-proxy << _EOF_
|
echo Acquire::http::Proxy \"$http_proxy\"; > /etc/apt/apt.conf.d/61-use-http-proxy
|
||||||
Acquire::http::Proxy "$http_proxy";
|
|
||||||
_EOF_
|
|
||||||
fi
|
fi
|
||||||
|
@ -5,6 +5,8 @@
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
if [ -e "/tmp/in_target.d/ssh-authorized-keys" ]; then
|
if [ -e "/tmp/in_target.d/ssh-authorized-keys" ]; then
|
||||||
sudo -u stack mkdir ~stack/.ssh
|
if [ -d ~stack ]; then
|
||||||
sudo -Hiu stack dd of=~stack/.ssh/authorized_keys oflag=append conv=notrunc if=/tmp/in_target.d/ssh-authorized-keys
|
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
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user