for every site a make file
DESCRIPTION
Presented at DrupalCon Copenhagen by Jeff Miccolis.TRANSCRIPT
vps.net25. aug 10:00
For every site, a .make file
Jeff Miccolis
Wednesday, August 25, 2010
I build drupal sitesI co-maintain Open AtriumI contribute to drush_make
Wednesday, August 25, 2010
You build drupal sitesYou’ve heard of drushYou’ve had deployment issues
Wednesday, August 25, 2010
If I’m lucky, you’ve used the Features module.
Wednesday, August 25, 2010
Problems, Tools, Gotchas...and your questions
Wednesday, August 25, 2010
a) Problems
Wednesday, August 25, 2010
The reality of deploying and maintaining drupal is ugly.
Wednesday, August 25, 2010
The standard way of deploying drupal...
Wednesday, August 25, 2010
...involves committing everything to a project specific SVN repository.The standard way of deploying drupal...
Wednesday, August 25, 2010
...and then using that SVN repository to “manage” production.The standard way of deploying drupal...
Wednesday, August 25, 2010
...is a heck of a lot better than nothing.The standard way of deploying drupal...
Wednesday, August 25, 2010
But what version of the Date module are you using there?
Wednesday, August 25, 2010
The last ‘stable’ release was September 16th, 2009Which version of Date module is that?
Wednesday, August 25, 2010
The last ‘stable’ release doesn’t work with php 5.3Which version of Date module is that?
Wednesday, August 25, 2010
Chances are you’re using a CVS checkout.Which version of Date module is that?
Wednesday, August 25, 2010
With a patch (or two) applied.Which version of Date module is that?
Wednesday, August 25, 2010
Do you know where your children are?
Wednesday, August 25, 2010
...and to make matters worse...
Wednesday, August 25, 2010
SA-CONTRIB-2010-666** not real **
Wednesday, August 25, 2010
...and you haven’t seen this site in 4 months.
**happens all the time**
Wednesday, August 25, 2010
The kids are in trouble.
Wednesday, August 25, 2010
We hack our way through. Commit semi-random patches and `svn co` production.The standard way of deploying drupal...
Wednesday, August 25, 2010
We can improve the ‘standard way’
Wednesday, August 25, 2010
Duplicative repositoriesProblems with the standard way...
Wednesday, August 25, 2010
Logs that mix of upstream fixes and custom workProblems with the standard way...
Wednesday, August 25, 2010
Too much detective work.Problems with the standard way...
Wednesday, August 25, 2010
Doesn’t make upstream contributions easy.Problems with the standard way...
Wednesday, August 25, 2010
Makes hacking upstream projects easy.Problems with the standard way...
Wednesday, August 25, 2010
b) Tools
Wednesday, August 25, 2010
Drush, Command line Drupal.http://drupal.org/project/drush
Wednesday, August 25, 2010
CLI?!?! WTF?!?!
Wednesday, August 25, 2010
Fast and scriptable.
Wednesday, August 25, 2010
**DRUSH_ DEMO**
Wednesday, August 25, 2010
Drush Makehttp://drupal.org/project/drush_make
Wednesday, August 25, 2010
It’s how we package install profiles on drupal.orgdrush_make is...
Wednesday, August 25, 2010
Not a Drupal module, a Drush extension!drush_make is...
Wednesday, August 25, 2010
This means it doesn’t need a Drupal site.
Wednesday, August 25, 2010
Installed in ~/.drushdrush_make is...
Wednesday, August 25, 2010
Used to make a ready to install Drupal platform.drush_make is...
Wednesday, August 25, 2010
Doesn’t Drupal come ‘ready to install’?
Wednesday, August 25, 2010
...when was the last time you deployed ‘just Drupal’?
Wednesday, August 25, 2010
Drupal core + views + cck + date...and probably a lot more.
Wednesday, August 25, 2010
A .make file is a manifest for your site.
Wednesday, August 25, 2010
core = 6.xprojects[] = drupal
Wednesday, August 25, 2010
projects[cck][subdir] = "contrib"projects[cck][version] = "2.8"
Wednesday, August 25, 2010
; This is a comment;; In short .make files use; .info file formatting.;; Also drush_make has a great; README.txt
Wednesday, August 25, 2010
projects[date][type] = "module"
projects[date][download][type] = "cvs"
projects[date][download][module] = "contributions/modules/date"
projects[date][download][revision] = "DRUPAL-6--2:2010-06-20"
Wednesday, August 25, 2010
projects[litecal][type] = "module"
projects[litecal][download][type] = "git"
projects[litecal][download][url] = "git://github.com/./litecal.git"
Wednesday, August 25, 2010
**DRUSH_MAKE DEMO**
Wednesday, August 25, 2010
Why can’t you generate the make file automatically?Question.
Wednesday, August 25, 2010
Text
http://drupal.org/project/cckWednesday, August 25, 2010
Wednesday, August 25, 2010
Wednesday, August 25, 2010
Projects vs. ModulesAnswer.
Wednesday, August 25, 2010
What about bugs in contrib module?Question.
Wednesday, August 25, 2010
Answer.
projects[prepopulate][patch][] = "http://../360613_20100812.patch"
Wednesday, August 25, 2010
What about random javascript libraries?Question.
Wednesday, August 25, 2010
libraries[jquery_ui][download][type] = "get"
libraries[jquery_ui][download][url] = "http.."
libraries[jquery_ui][directory_name] = "jquery.ui"
libraries[jquery_ui][destination] = "modules/contrib/jquery_ui"
Answer.
Wednesday, August 25, 2010
Isn’t it slow to do all this downloading?Question.
Wednesday, August 25, 2010
Finally, a useful purpose for squid!http://reluctanthacker.rollett.org/node/114
Wednesday, August 25, 2010
Can I reuse snippits of make files somehow?Question.
Wednesday, August 25, 2010
Yes, two ways; recursion & inclusion.Answer
Wednesday, August 25, 2010
Recursion: if a project has a .make file it will be run.
Wednesday, August 25, 2010
Recursion: Avoid it.*Rarely useful, mostly confusing.*except with install profiles.
Wednesday, August 25, 2010
Inclusion: Allow a make file to reference another make file.
Wednesday, August 25, 2010
Inclusion: Use it.References via URLs, items in the referenced file can be overridden.
Wednesday, August 25, 2010
; Include Open Atriumincludes[openatrium] = http://...
; Include Open Atrium includes[openatrium] = http://drupalcode.org/viewvc/drupal/contributions/profiles/openatrium/openatrium.make?view=co&pathrev=HEAD
Wednesday, August 25, 2010
Use overrides to grab CVS checkouts, experimental forks, more recent versions, etc
Wednesday, August 25, 2010
Ok, cool. How do I use this again?
Wednesday, August 25, 2010
**BUILDKIT DEMO**
Wednesday, August 25, 2010
c) Gotchas, best practices, concepts, etc...
Wednesday, August 25, 2010
Make files are portable.They’re manifests, not a personal ‘save’ button
Wednesday, August 25, 2010
Tag versions.If your make file is pointing at HEAD it’s not doing it’s job.
Wednesday, August 25, 2010
Use comments &Link patchesA few words can help a lot.
Wednesday, August 25, 2010
Profile .make vs. Distro .make
Wednesday, August 25, 2010
Used to make an install profile. No Core.profile .make
Wednesday, August 25, 2010
It’s what we use on Drupal.orgprofile .make
Wednesday, August 25, 2010
Includes core.distro .make
Wednesday, August 25, 2010
Is what I use for Openatrium.comdistro .make
Wednesday, August 25, 2010
The distro .make retrieves and builds the profile.make.distro .make
Wednesday, August 25, 2010
This is the one place the recursion behavior works for us.distro .make
Wednesday, August 25, 2010
Small scripts go a long way.Like Open Atrium’s rebuild.sh
Wednesday, August 25, 2010
You’ll still want a project repository.
Wednesday, August 25, 2010
An install profile.You’r new project repository.
Wednesday, August 25, 2010
Custom themes and modules.Your new project repository.
Wednesday, August 25, 2010
A rebuild script.Your new project repository.
Wednesday, August 25, 2010
Nothing that already has a home.Your new project repository.
Wednesday, August 25, 2010
Forking projects and contributing back.
Forking for karma.
Wednesday, August 25, 2010
The patches in your make file need to be public.
Forking for karma.
Wednesday, August 25, 2010
Write patches that have a chance...
Forking for karma.
Wednesday, August 25, 2010
Post them on the project’s issue queue.
Forking for karma.
Wednesday, August 25, 2010
What if everyone did this?
Forking for karma.
Wednesday, August 25, 2010
In conclusion, two things;
Wednesday, August 25, 2010
a) I don’t ever want to wonder; did we apply that patch to this site?
Wednesday, August 25, 2010
b) patches belong upstream. Let’s keep them there.
Wednesday, August 25, 2010
Questions?
Wednesday, August 25, 2010
http://cph2010.drupal.org/node/14588
Wednesday, August 25, 2010