Jenkins and Drupal
Juampy NR - @juampynr
DrupalCamp Costa Rica 2015
What is Jenkins?
“Jenkins is an award-winning application that monitors executions of repeated jobs,
such as building a software project or jobs run by cron.”
Jenkins Wiki
Setting up Jenkins
Installation.
Adding credentials.
Adding a node.
Job examples
- Running cron.
- Introducing continuous integration.
- Downloading data from production to development
- Deploying a release.
Running cron - setting the node
Running cron - notifications
Introducing Continuous Integration
Continuous integration (CI) is the practice, in software engineering, of merging all
developer working copies with a shared mainline several times a day.
Wikipedia
CI - Watching master branch
CI - Triggering on git push
CI - Execute shell script
Downloading data from Production to Development (Downsync)
Downsync - Testing access from source to target
juampy@juampy-box:~ $ ssh dev.example.com
juampy@dev:~$ sudo su jenkins
jenkins@dev:/home/juampy$ cd /var/www/edit.example/docroot
jenkins@dev:/var/www/edit.example.com/docroot$ drush @lullabot.prod status
Drupal version : 7.38
Site URI : http://edit.lullabot.com
Database driver : mysql
Drupal bootstrap : Successful
Drupal user : Anonymous
Site path : sites/default
File directory path : sites/default/files
Temporary file directory path : /tmp
jenkins@dev:/var/www/edit.example.com/docroot$ drush @lullabot.prod status
jenkins@dev:/var/www/edit.example.com/docroot$ exit
exit
juampy@dev:~$ exit
logout
Connection to dev.example.com closed.
Downsync - Avoiding collisions between jobs
CI - Execute shell script
Deployments - Adding parameters
Deployments - Shell script
Alternative ways to trigger jobs
- Manual trigger.
- Jenkins IRC bot.
- When another job finishes.
- When a certain comment is made in GitHub.
Jenkins and Drupal
Juampy NR - @juampynr
DrupalCamp Costa Rica 2015