JENKINS - midcamp.org or how I... · JENKINS • Long, long time ago was 'Hudson' • After Oracle:...
Transcript of JENKINS - midcamp.org or how I... · JENKINS • Long, long time ago was 'Hudson' • After Oracle:...
![Page 1: JENKINS - midcamp.org or how I... · JENKINS • Long, long time ago was 'Hudson' • After Oracle: "Time for a new name!" • Now under the stewardship of Cloudbees • Used to be](https://reader034.fdocuments.us/reader034/viewer/2022042102/5e7ecfdf7c196616e65ec541/html5/thumbnails/1.jpg)
JENKINS
or: How I learned to stop worrying and love automation
#MidCamp 2018 – Jeff Geerling
![Page 2: JENKINS - midcamp.org or how I... · JENKINS • Long, long time ago was 'Hudson' • After Oracle: "Time for a new name!" • Now under the stewardship of Cloudbees • Used to be](https://reader034.fdocuments.us/reader034/viewer/2022042102/5e7ecfdf7c196616e65ec541/html5/thumbnails/2.jpg)
Jeff Geerling (geerlingguy)
• Drupalist and Acquian
• Writer
• Automator of things
![Page 3: JENKINS - midcamp.org or how I... · JENKINS • Long, long time ago was 'Hudson' • After Oracle: "Time for a new name!" • Now under the stewardship of Cloudbees • Used to be](https://reader034.fdocuments.us/reader034/viewer/2022042102/5e7ecfdf7c196616e65ec541/html5/thumbnails/3.jpg)
![Page 4: JENKINS - midcamp.org or how I... · JENKINS • Long, long time ago was 'Hudson' • After Oracle: "Time for a new name!" • Now under the stewardship of Cloudbees • Used to be](https://reader034.fdocuments.us/reader034/viewer/2022042102/5e7ecfdf7c196616e65ec541/html5/thumbnails/4.jpg)
AGENDA
1. Installing Jenkins
2. Configuation and Backup
3. Jenkins and Drupal
![Page 5: JENKINS - midcamp.org or how I... · JENKINS • Long, long time ago was 'Hudson' • After Oracle: "Time for a new name!" • Now under the stewardship of Cloudbees • Used to be](https://reader034.fdocuments.us/reader034/viewer/2022042102/5e7ecfdf7c196616e65ec541/html5/thumbnails/5.jpg)
JENKINS
![Page 6: JENKINS - midcamp.org or how I... · JENKINS • Long, long time ago was 'Hudson' • After Oracle: "Time for a new name!" • Now under the stewardship of Cloudbees • Used to be](https://reader034.fdocuments.us/reader034/viewer/2022042102/5e7ecfdf7c196616e65ec541/html5/thumbnails/6.jpg)
JENKINS
• Long, long time ago was 'Hudson'
![Page 7: JENKINS - midcamp.org or how I... · JENKINS • Long, long time ago was 'Hudson' • After Oracle: "Time for a new name!" • Now under the stewardship of Cloudbees • Used to be](https://reader034.fdocuments.us/reader034/viewer/2022042102/5e7ecfdf7c196616e65ec541/html5/thumbnails/7.jpg)
JENKINS
• Long, long time ago was 'Hudson'
![Page 8: JENKINS - midcamp.org or how I... · JENKINS • Long, long time ago was 'Hudson' • After Oracle: "Time for a new name!" • Now under the stewardship of Cloudbees • Used to be](https://reader034.fdocuments.us/reader034/viewer/2022042102/5e7ecfdf7c196616e65ec541/html5/thumbnails/8.jpg)
JENKINS
• Long, long time ago was 'Hudson'
![Page 9: JENKINS - midcamp.org or how I... · JENKINS • Long, long time ago was 'Hudson' • After Oracle: "Time for a new name!" • Now under the stewardship of Cloudbees • Used to be](https://reader034.fdocuments.us/reader034/viewer/2022042102/5e7ecfdf7c196616e65ec541/html5/thumbnails/9.jpg)
JENKINS
• Long, long time ago was 'Hudson'
• After Oracle: "Time for a new name!"
![Page 10: JENKINS - midcamp.org or how I... · JENKINS • Long, long time ago was 'Hudson' • After Oracle: "Time for a new name!" • Now under the stewardship of Cloudbees • Used to be](https://reader034.fdocuments.us/reader034/viewer/2022042102/5e7ecfdf7c196616e65ec541/html5/thumbnails/10.jpg)
JENKINS
• Long, long time ago was 'Hudson'
• After Oracle: "Time for a new name!"
• Now under the stewardship of Cloudbees
![Page 11: JENKINS - midcamp.org or how I... · JENKINS • Long, long time ago was 'Hudson' • After Oracle: "Time for a new name!" • Now under the stewardship of Cloudbees • Used to be](https://reader034.fdocuments.us/reader034/viewer/2022042102/5e7ecfdf7c196616e65ec541/html5/thumbnails/11.jpg)
JENKINS
• Long, long time ago was 'Hudson'
• After Oracle: "Time for a new name!"
• Now under the stewardship of Cloudbees
• Used to be only name in the open source CI game
• Today: GitLab CI, Concourse, Travis CI, CircleCI, CodeShip...
![Page 12: JENKINS - midcamp.org or how I... · JENKINS • Long, long time ago was 'Hudson' • After Oracle: "Time for a new name!" • Now under the stewardship of Cloudbees • Used to be](https://reader034.fdocuments.us/reader034/viewer/2022042102/5e7ecfdf7c196616e65ec541/html5/thumbnails/12.jpg)
RUNNING JENKINS
• Server:
• RAM (Jenkins is a hungry butler!)
• CPU (if jobs need it)
• Disk (don't fill the system disk!)
![Page 13: JENKINS - midcamp.org or how I... · JENKINS • Long, long time ago was 'Hudson' • After Oracle: "Time for a new name!" • Now under the stewardship of Cloudbees • Used to be](https://reader034.fdocuments.us/reader034/viewer/2022042102/5e7ecfdf7c196616e65ec541/html5/thumbnails/13.jpg)
RUNNING JENKINS
• Monitor RAM, CPU, Disk
• Monitor jenkins service if RAM is limited
• enforce-jenkins-running.sh
![Page 14: JENKINS - midcamp.org or how I... · JENKINS • Long, long time ago was 'Hudson' • After Oracle: "Time for a new name!" • Now under the stewardship of Cloudbees • Used to be](https://reader034.fdocuments.us/reader034/viewer/2022042102/5e7ecfdf7c196616e65ec541/html5/thumbnails/14.jpg)
INSTALLING JENKINS
• Install Java.
• Install Jenkins.
• Done!
Image source: https://medium.com/@ricardoespsanto/jenkins-is-dead-long-live-concourse-ce13f94e4975
![Page 15: JENKINS - midcamp.org or how I... · JENKINS • Long, long time ago was 'Hudson' • After Oracle: "Time for a new name!" • Now under the stewardship of Cloudbees • Used to be](https://reader034.fdocuments.us/reader034/viewer/2022042102/5e7ecfdf7c196616e65ec541/html5/thumbnails/15.jpg)
INSTALLING JENKINS
• Install Java.
• Install Jenkins.
• Done!
Image source: https://medium.com/@ricardoespsanto/jenkins-is-dead-long-live-concourse-ce13f94e4975
![Page 16: JENKINS - midcamp.org or how I... · JENKINS • Long, long time ago was 'Hudson' • After Oracle: "Time for a new name!" • Now under the stewardship of Cloudbees • Used to be](https://reader034.fdocuments.us/reader034/viewer/2022042102/5e7ecfdf7c196616e65ec541/html5/thumbnails/16.jpg)
Image source: https://www.albany.edu/news/69224.php
(Your Jenkins server, 3 years later)
![Page 17: JENKINS - midcamp.org or how I... · JENKINS • Long, long time ago was 'Hudson' • After Oracle: "Time for a new name!" • Now under the stewardship of Cloudbees • Used to be](https://reader034.fdocuments.us/reader034/viewer/2022042102/5e7ecfdf7c196616e65ec541/html5/thumbnails/17.jpg)
INSTALLING JENKINS
• Securely:
• Java
• Jenkins
• Nginx
• Let's Encrypt
![Page 18: JENKINS - midcamp.org or how I... · JENKINS • Long, long time ago was 'Hudson' • After Oracle: "Time for a new name!" • Now under the stewardship of Cloudbees • Used to be](https://reader034.fdocuments.us/reader034/viewer/2022042102/5e7ecfdf7c196616e65ec541/html5/thumbnails/18.jpg)
INSTALLING JENKINS
• Repeatably:
• CI for Jenkins (CI-ception!)
• Local or test Jenkins environment
• You wouldn't develop a Drupal site in prod (riiiiight?), so why would you develop your automation in prod?!
![Page 19: JENKINS - midcamp.org or how I... · JENKINS • Long, long time ago was 'Hudson' • After Oracle: "Time for a new name!" • Now under the stewardship of Cloudbees • Used to be](https://reader034.fdocuments.us/reader034/viewer/2022042102/5e7ecfdf7c196616e65ec541/html5/thumbnails/19.jpg)
INSTALLING JENKINS
(If you want to skip ahead...)
https://github.com/geerlingguy/drupal-jenkins-multisite
![Page 20: JENKINS - midcamp.org or how I... · JENKINS • Long, long time ago was 'Hudson' • After Oracle: "Time for a new name!" • Now under the stewardship of Cloudbees • Used to be](https://reader034.fdocuments.us/reader034/viewer/2022042102/5e7ecfdf7c196616e65ec541/html5/thumbnails/20.jpg)
INSTALLING JENKINS
(If you want the easier, but expensive-r, route)
https://www.cloudbees.com/
![Page 21: JENKINS - midcamp.org or how I... · JENKINS • Long, long time ago was 'Hudson' • After Oracle: "Time for a new name!" • Now under the stewardship of Cloudbees • Used to be](https://reader034.fdocuments.us/reader034/viewer/2022042102/5e7ecfdf7c196616e65ec541/html5/thumbnails/21.jpg)
INSTALLING JENKINS
(If you want it RIGHT NOW!)
docker run -d -p 8080:8080 jenkinsci/blueocean
![Page 22: JENKINS - midcamp.org or how I... · JENKINS • Long, long time ago was 'Hudson' • After Oracle: "Time for a new name!" • Now under the stewardship of Cloudbees • Used to be](https://reader034.fdocuments.us/reader034/viewer/2022042102/5e7ecfdf7c196616e65ec541/html5/thumbnails/22.jpg)
WE'RE IN
![Page 23: JENKINS - midcamp.org or how I... · JENKINS • Long, long time ago was 'Hudson' • After Oracle: "Time for a new name!" • Now under the stewardship of Cloudbees • Used to be](https://reader034.fdocuments.us/reader034/viewer/2022042102/5e7ecfdf7c196616e65ec541/html5/thumbnails/23.jpg)
CONFIGURING JENKINS
• Plugins:
• Very much like Drupal modules
• (This has good and bad implications 😛)
![Page 24: JENKINS - midcamp.org or how I... · JENKINS • Long, long time ago was 'Hudson' • After Oracle: "Time for a new name!" • Now under the stewardship of Cloudbees • Used to be](https://reader034.fdocuments.us/reader034/viewer/2022042102/5e7ecfdf7c196616e65ec541/html5/thumbnails/24.jpg)
CONFIGURING JENKINS
• Blue Ocean:
• No more 00's UI!
• Follow this issue for setting it as default
![Page 25: JENKINS - midcamp.org or how I... · JENKINS • Long, long time ago was 'Hudson' • After Oracle: "Time for a new name!" • Now under the stewardship of Cloudbees • Used to be](https://reader034.fdocuments.us/reader034/viewer/2022042102/5e7ecfdf7c196616e65ec541/html5/thumbnails/25.jpg)
CONFIGURING JENKINS
• Secrets:
• SSH keys
• API keys
• AWS credentials
Image source: https://livinghiv.com/2014/09/07/least-secret-secret/
![Page 26: JENKINS - midcamp.org or how I... · JENKINS • Long, long time ago was 'Hudson' • After Oracle: "Time for a new name!" • Now under the stewardship of Cloudbees • Used to be](https://reader034.fdocuments.us/reader034/viewer/2022042102/5e7ecfdf7c196616e65ec541/html5/thumbnails/26.jpg)
![Page 27: JENKINS - midcamp.org or how I... · JENKINS • Long, long time ago was 'Hudson' • After Oracle: "Time for a new name!" • Now under the stewardship of Cloudbees • Used to be](https://reader034.fdocuments.us/reader034/viewer/2022042102/5e7ecfdf7c196616e65ec541/html5/thumbnails/27.jpg)
CONFIGURING JENKINS
Image source: http://ru.memegenerator.net/instance/69770876/overly-excited-oprah-you-get-root-you-get-root-everyone-gets-root
![Page 28: JENKINS - midcamp.org or how I... · JENKINS • Long, long time ago was 'Hudson' • After Oracle: "Time for a new name!" • Now under the stewardship of Cloudbees • Used to be](https://reader034.fdocuments.us/reader034/viewer/2022042102/5e7ecfdf7c196616e65ec541/html5/thumbnails/28.jpg)
CONFIGURING JENKINS
• Access Control:
• Use the Role Strategy Plugin
• BUT, be careful, and TEST after upgrades!
Image source: https://livinghiv.com/2014/09/07/least-secret-secret/
![Page 29: JENKINS - midcamp.org or how I... · JENKINS • Long, long time ago was 'Hudson' • After Oracle: "Time for a new name!" • Now under the stewardship of Cloudbees • Used to be](https://reader034.fdocuments.us/reader034/viewer/2022042102/5e7ecfdf7c196616e65ec541/html5/thumbnails/29.jpg)
BACKING UP JENKINS
Back up JENKINS_HOME to Amazon S3
tl;dr: jenkins-backup.yml
![Page 30: JENKINS - midcamp.org or how I... · JENKINS • Long, long time ago was 'Hudson' • After Oracle: "Time for a new name!" • Now under the stewardship of Cloudbees • Used to be](https://reader034.fdocuments.us/reader034/viewer/2022042102/5e7ecfdf7c196616e65ec541/html5/thumbnails/30.jpg)
JENKINS & DRUPAL
What can we do with them?
![Page 31: JENKINS - midcamp.org or how I... · JENKINS • Long, long time ago was 'Hudson' • After Oracle: "Time for a new name!" • Now under the stewardship of Cloudbees • Used to be](https://reader034.fdocuments.us/reader034/viewer/2022042102/5e7ecfdf7c196616e65ec541/html5/thumbnails/31.jpg)
JENKINS & DRUPAL
• Quite a lot, actually!
• Run tests (PHPUnit, Behat, etc.)
• Build dependencies (Composer, npm/yarn)
• Run cron
• Deploy new sites
• Deploy updates to existing sites
![Page 32: JENKINS - midcamp.org or how I... · JENKINS • Long, long time ago was 'Hudson' • After Oracle: "Time for a new name!" • Now under the stewardship of Cloudbees • Used to be](https://reader034.fdocuments.us/reader034/viewer/2022042102/5e7ecfdf7c196616e65ec541/html5/thumbnails/32.jpg)
![Page 33: JENKINS - midcamp.org or how I... · JENKINS • Long, long time ago was 'Hudson' • After Oracle: "Time for a new name!" • Now under the stewardship of Cloudbees • Used to be](https://reader034.fdocuments.us/reader034/viewer/2022042102/5e7ecfdf7c196616e65ec541/html5/thumbnails/33.jpg)
JENKINS & DRUPAL
• midwesternmac.com ('mm'):
• Drupal 7
• Multisite, 6 sites total
![Page 34: JENKINS - midcamp.org or how I... · JENKINS • Long, long time ago was 'Hudson' • After Oracle: "Time for a new name!" • Now under the stewardship of Cloudbees • Used to be](https://reader034.fdocuments.us/reader034/viewer/2022042102/5e7ecfdf7c196616e65ec541/html5/thumbnails/34.jpg)
JENKINS & DRUPAL
(Demo)
![Page 35: JENKINS - midcamp.org or how I... · JENKINS • Long, long time ago was 'Hudson' • After Oracle: "Time for a new name!" • Now under the stewardship of Cloudbees • Used to be](https://reader034.fdocuments.us/reader034/viewer/2022042102/5e7ecfdf7c196616e65ec541/html5/thumbnails/35.jpg)
Hey, I do this more than one time ever... I should
automate it!
Image source: Jack Moreh / freerangestock.com
![Page 36: JENKINS - midcamp.org or how I... · JENKINS • Long, long time ago was 'Hudson' • After Oracle: "Time for a new name!" • Now under the stewardship of Cloudbees • Used to be](https://reader034.fdocuments.us/reader034/viewer/2022042102/5e7ecfdf7c196616e65ec541/html5/thumbnails/36.jpg)
XKCD: 1205
![Page 37: JENKINS - midcamp.org or how I... · JENKINS • Long, long time ago was 'Hudson' • After Oracle: "Time for a new name!" • Now under the stewardship of Cloudbees • Used to be](https://reader034.fdocuments.us/reader034/viewer/2022042102/5e7ecfdf7c196616e65ec541/html5/thumbnails/37.jpg)
OTHER SOURCES
• Tons of great tutorials on Drupal + Jenkins, e.g.:
• Chromatic: D8 Deployments, Backups
• Lullabot: One-click deployments
• Phil Norton: Getting started
![Page 38: JENKINS - midcamp.org or how I... · JENKINS • Long, long time ago was 'Hudson' • After Oracle: "Time for a new name!" • Now under the stewardship of Cloudbees • Used to be](https://reader034.fdocuments.us/reader034/viewer/2022042102/5e7ecfdf7c196616e65ec541/html5/thumbnails/38.jpg)
THANKS!
• Support my open source work on Patreon: https://www.patreon.com/geerlingguy