- Jenkins server with docker and pipeline support
- Tweak variables in: roles/jenkins/defaults/main.yml
- Add new jobs to: roles/jenkins/files/jobs
- By default jenkins runs on port 8085
- No authorization needed
- No manual configuration required
- Vagrant
- Ansible >= 2.0
- Check out repo
- Make sure to have installed the dependencies
- Run
vagrant up jenkins
- Run Ansible:
ansible-playbook -i inventory site.yml -k -b -K -u vagrant
Password:vagrant
- Go to Jenkins UI: http://10.2.2.2:8085/ and run the build
- Test your application: http://10.2.2.2:8080/sample
inventory
:
- defines servers
site.yml
:
- assigns roles
Vagrantfile
:
- Configures basic ubuntu vm with private ip: 10.2.2.2
roles/jenkins/defaults/main.yml
:
- all the variables used by Jenkins are here
roles/jenkins/tasks/install.yml
:
- configures java, jenkins, docker installation
- Adds global config and jobs configs
roles/jenkins/tasks/install-plugins.yml
:
- installs plugins through Jenkins API
roles/jenkins/files/global-config.xml
:
- main configuration file for Jenkins (altered to disable security)
roles/jenkins/files/jobs/super-duper-app
:
- Jenkins job config. Creates a remote-pipeline project.
- Pipeline for java app deployed to docker demonstration here