This is an ansible playbook to install and configure Jenkins-CI.
The playbook will install NGINX, configure SSL, Docker, a local-only SMTP server and Jenkins. It will also install Docker-maintenance cron jobs and Jenkins-backup scripts to S3.
Used in combination with Deis for Docker-based Continuous Delivery of Websites. See also webprod-deis.
Add your SSL certificates in ssl/
folder. Files ssl/ssl.key
and
ssl/ssl.crt
are needed. These will be copied to your server. You
can use a self-signed certificate. Search 'generate self signed SSL
certificate` on instructions on how to create one.
Copy local_variables-dist.yml
to local_variables.yml
and adjust
to your preferences.
Add your host in hosts
. Example hosts
[jenkins]
127.0.0.1
Run the playbook:
ansible-playbook -i hosts site.yml
Yay!
This playbook installs two GitHub plugins, GitHub and GitHub Pull Request Builder. Read the instructions on how to enable these. In some cases, the plugins fail to install their hooks, but you can still add them manually.
For GitHub
https://<your_server>/github-webhook/
x-www-form-urlencoded
Just the push event
For GitHub Pull Request Builder
https://<your_server>/ghprbhook/
x-www-form-urlencoded
Pull Request and Issue Comment
This playbook expects that you use the ThinBackup Jenkins plugin and that you save backups in /var/lib/jenkins/backups
.
In case of a disaster follow these steps:
/var/lib/jenkins/backups
./var/lib/jenkins/backups
. Restart Jenkins.Note that environment passwords used in jobs will not be restored and you will have to do this manually.