Drupal Distributions: The Dos and Don'ts

A Drupal Distribution (distro) is a package of selected and configured modules that can be installed at once. Some known Drupal distributions are Acquia Drupal, Pressflow and OpenAtrium. In their presentation they will discuss various architectural challenges of building and managing a distribution, solutions such as Installation Profiles, CTools, Features, Context, Drush etc., as well as how to facilitate two-way communications with the community, involve your users and where to get help.

Agenda

What are distributions?

A Drupal distribution is a Drupal installer packaged differently than the one default on drupal.org. And installation of distros should be as simple as possible.

Typical architecture of a distribution

Included in a distribution are:

  • The Drupal core
  • A installation profile
  • A set of modules
  • Themes
  • Third-party libraries (eg charts, Javascript, etc)

Install profiles

  • Can only be chosen on install (one moment to choose it).
  • They provide custom install tasks (default settings, enable and configure modules, creating content types and user roles, etc)
  • They provide modules and themes that are only available to sites that use that profile.

Exportables

This gives you the change to maintain distributions in long term.

  • Distinguish between content and configuration.
  • Capture the configuration in code.
  • Make long term configuration management possible.

Toolchain

  • Features module
    Manage your settings (CCK, Views, etc) as if it were custom modules
  • Context module
    Gives you a way to export your blocks configuration (blocks cannot be exported using features)
  • Kit specification
    A document that describes how to name the components (user roles, features, etc) of your install profile. This sort of establishes a baseline of what is a good name of a views, content type, etc.
  • Drush & Drush Make
    A command-line utility that speeds up Drupal maintainance. With Drush Make you can write up a manifest (list of all modules, patches, etc that are required by your install profile).

Some tips

  1. An Install Profile is just a list of modules!
    The don't handle upgrades. Keep them small and clean, so updates can be handled by features and exportables.
  2. Long lists of modules can take a while to install.
    An average distribution like Open Atrium can have over 150 modules. So use batch processing.
  3. Organize Features functionally.
    Seperate frequently-changing features from permanent. It's a good idea to have a feature for echt content type and place shared settings in an unique feature.
  4. Context Layouts are powerful.
    Always define a global context (a context that is always on, like header and footer) and beware of overlapping contexts. Contexts are pluggable, so a good idea is to write a custom condition or reaction if needed.
  5. Always fix module versions in your Drush Make.

Community infrastructure

Drush Make (and thus distributions) on drupal.org

Since a while it's possible to publish Installation Profiles on Drupal.org. This has some pros and cons:

  • Benefit: better automation.
  • Challenge: third-party libraries
    Drupal.org doesn't allow to hosts third-party libraries on d.o. due to the GPL licence. Thoughs are to make a white-list of allowed libraries.
  • Challenge: running custom packaging routines and security
  • Current State
    The package script of drupal.org an only package full releases, not in-betweens, or tags.

Localizing a Distribution

You can setup your own localization server, but it can also be done using .pos files together with localize.drupal.org.

  • http://localize.drupal.org/
  • Setting up a localization server
  • Syncing with l.d.o.
  • Translating an install profile and bundling it with .pos files

Building a community

  • OpenAtrium Experience
    During the development of OpenAtrium, Drupal.org didn't support Distributions. That's why Development Seed chose to manage their issues on github. However, the github issue tracker is very bad and the audience using it differs from Drupal developers.
  • OpenPublish Experience
    When you build a Distribution, try to share it as quick as possible with the community. People love to help (translating, patching, etc), buidling distros alone is undoable. Having a single place to gather issues really helps.

Next post

For passion, with pleasure

Read More »