Jenkins
Jenkins is an open source automation server.
What is Jenkins?
Jenkins is an open source automation server
- Automation server runs jobs automatically
- Open source - no lock in
- Java - can install on Windows, Mac, Linux
- Popular (Industry standard, lots of Plugins for different use cases)
- Scalable (able to add Executor/slave servers)
Example Jobs
What are some example jobs that the Jenkins server can automate?
- Terminal Commands
- Shell Scripts
- Python
- Database Queries
Commands can be created through the GUI or through an API (e.g. Python)
- On Jenkins Dockerfile, saved as xml configs under
/var/jenkins_home/jobs/<job_name/config.xml
How does it help my team?
Imagine we’re in an assembly line
- Need to define what gets handed off from one person to another (e.g. go-live)
- More difficult than assembly line since we also maintain projects
So how does a tool like Jenkins help?
- Requirements defined in code (as integration tests)
- Continuous testing (less scared of changes)
- Visibility of changes across departments
- More concrete deliverables between departments
More Detailed Examples
Example integration test across departments
- Data - HTTP request to MLS board and write response to database
- Dep - Create API using data from database
- Dev - GET request from API, create webpage using that data
- QA - Selenium to automatically test webpage across different browsers
- PM - Create a View for this job chain, set email alerts when job is broken
Example integration test in a department (Data)
- Install and use plugins - Poll GitHub for repo changes
- Run unit tests, integration tests
- Run scripts on server (groovy)
Final Notes
If it’s important, it needs to be continuously tested.
- “Code without tests is bad code. It doesn’t matter how well written it is;
it doesn’t matter how pretty or object-oriented or well-encapsulated it is.
With tests, we can change the behavior of our code quickly and verifiably” - Michael C Feathers
- Needs to be a top down decision to enforce tests - no PRs accepted unless there’s a test
Try Jenkins
- Install locally via Jenkins installation page and/or use Jenkins Dockerfile