You will need Vagrant and Virtualbox installed on your system. Also you will need to clone this repository and get all the roles:
git clone https://github.com/amatas/vagrant-jenkins-test
cd vagrant-jenkins-test
ansible-galaxy install -r requirements.yml -p provisioning/roles/
The Vagranfile is also compatible with vagrant-libvirt
By default the [Vagrantfile] will create 3 VMs, one master and two slaves. Each VM will use 1G of RAM, so at least 3G of free ram is required.
The following steps are performed when the VMs are provisioned:
On master:
- Setup Jenkins master service (ansible-jenkins-master)
- Configure Jenkins' users (ansible-jenkins-master)
- Configure Jenkins' credentials (ansible-jenkins-master)
- Download and install plugins (ansible-jenkins-master)
- Install Jenkins-job-builder and configure the API user (ansible-jenkins-master)
- Install a reverse proxy http://10.0.0.10/ (ansible-nginx-reverse)
- Install docker-registry (ansible-docker-registry)
- Register a Jenkins job
On slaves:
- Setup Jenkins node and register at the server
- Install docker daemon (ansible-docker)
- Install certificates to stablis TLS connection to the docker-registry
After provision you can access to the Jenkins Dashboard (u: admin, p: root) and trigger the build.