This presentation will cover a simple setup of a Jenkins (it can even run on your laptop), and a set of scripts will be demonstrated that enable the following automation and workflow:
- Run Drupal cron from Jenkins via drush
- Create backups
- Restore from backups
- Refresh a development environment with the database from live
- Update stage, triggered on a commit to version control
- Update production, manually triggered after testing stage
- As much as this will done live as possible; slides and screenshots will be a fallback. - Electronic copy of the scripts and other files will be provided, so that attendees can modify and use them.
The presentation is aimed at smaller teams and freelancers, who might consider an automated setup to have too much overhead to be worth it; the goal is to demonstrate that there is a good payoff from a small investment in DevOps.
1. Simple DevOps With
Jenkins
Robert Ristroph
Email & AIM: robert@fourkitchens.com
Google Chat: rgristroph@gmail.com
Twitter: @robgr
Slides:
http://www.nyccamp.org/sessions/simple-
devops-using-jenkins
2. What is DevOps ?
Trendy buzzword for a lot of common sense
Automate everything
“Development” and “Operations” cannot be
separate, and must support each other
Associated with big software teams that can
afford bureaucratic overhead (started as an
anti-bureaucratic movement)
However small shops can take the best ideas
and use them
3. What is Jenkins ?
http://jenkins-ci.org/
Java based; a server, but also useful running
locally
Wide variety of plugins
Supportive community - #jenkinsci on
irc.freenode.net
Open Source, MIT License
Not the only option, but best supported
4. Jenkins Architecture
A master server runs the java server
Users (mostly) interact through a web
interface
“Nodes” (or “workers”) are computers that
the master can log into through ssh (key
based)
“Jobs” are run on workers, the results are
“builds”
8. Features / Update Hooks
Code flows forward, Database backward
“Zero Touch” on live (if possible)
Not always practical for a small group or
quick jobs
9. Jenkins / Drush replacing
cron
Run “drush cron” from a Jenkins job
Logs results
Move custom heavy tasks (search indexing)
to their own drush command and Jenkins job
Can use php-cli.ini to allow more memory
10. Backups
Consider the “Backup and Migrate” module
or tar / drush sql-dump
You MUST test backups
You MUST automate backups – otherwise it
won't happen
11. Summary
Not a big overhead to start getting payoff
Professionalizes your operation, even if you
are a lone freelancer
Come to me after the talk for examples of
the jobs shown, or other questions