On this page:
  • Drupal Features and Drush: updating our development workflow

Drupal Features and Drush: updating our development workflow

I’m working with two other people on a Drupal project, so we’re coordinating our work through a Subversion source code repository. A lot has changed in Drupal since the days when I dived into the source code to figure out the code I needed in order to duplicate the configuration changes I made through the web interface (Drupal staging and deployment: it’s all code). Now, the Features module can export various configuration bits as a module that you can check into your source tree and enable on your site. It will even show you which settings you’ve overridden through the web interface, so you can regenerate the code and make sure everything’s included.

Drush (the Drupal shell) has some commands that make Drupal features even easier to use. For example, I use drush features-diff <feature_name> to see which settings I’ve changed, and drush features-update to re-export the settings to source code.

Because we’ll be using Features to share our changes instead of working off SQL backups, I need to make sure that I’ve included all the relevant components in the features I create. One way to test that is to use Backup and Migrate to save my configured database (just in case!), load a previous backup, enable the feature, and confirm that everything works as expected.

Tests using either SimpleTest or Selenium would be the best way to confirm everything is working, of course. When Stuart comes back on Monday, he can help us set up an environment using hudson as a continuous integration server. Stuart has set up Selenium tests before, and it might be possible to use simpletest with hudson also.