So you want to provide a Distribution on Drupal.org? Great! The Drupal.org packaging system will take the code for a project, assemble it into an easily downloadable format, and post it to the project's pages on Drupal.org.
Here are the steps:
- Assemble the pre-requisites
- Create a Drush Make file
- Convert to a Drupal.org-specific Drush Make file
- Build and verify it works
- Commit your code to Git
- Release your code on Drupal.org
- Maintain your distribution
Step 1: Pre-requisites
- Drush 5.x+.
- Drupal.org Drush, a Drush extension which is required for running tests on makefiles. See this post for installation instructions.
- A full project node on Drupal.org, of project type "Distribution".
Step 2: Drush Make file
A Drush Make file is essentially a "recipe" that explains how to gather up all of the dependencies for a Drupal installation.
See Full example drupal-org.make file for a working example of all valid properties supported by Drupal.org's packaging system. You can either create/edit these by hand, or you can auto-generate one in seconds by changing into any working Drupal site's root directory and running the command:
drush generate-makefile drupal-org.make
Drush make will inspect your current install and write a
drupal-org.make file with the latest stable releases for all of the modules/themes it finds.
TODO: Except for.
Edit this file and remove the
projects[drupal][version] = "X" line.
Step 3: Converting to a Drupal.org-specific Drush Make file.
Once you have a valid Drush Make file, the next step is to convert it to one suitable for Drupal.org packaging. The Drupal.org version is essentially the same as a normal Drush Make file, but with a few important differences explained at Drupal.org distribution packaging requirements.
Verify make file
Update: You need drupalorg_drush, install instructions at
To check whether your make file is Drupal.org-compatible, run the following command:
If you run
drush verify-makefile with no arguments, it will search for a
drupal-org.make file (and optionally a
drupal-org-core.make file) in the current directory and validate those for you. If you want to verify another .make file to see if it would work as a
drupal-org.make file, you can provide the filename like so:
drush verify-makefile foo.make
Note that you must resolve all errors before proceeding. See Common Drush Make errors and their solutions for some common errors and how to fix them.
If all goes well, you should see the following output from Drush:
Makefile drupal-org.make passed. [ok]
If your distribution requires patches to Drupal core, a -dev release, a checkout of a specific Git revision, or anything more complicated than an official release of core, you need to define how core should be built in a separate file called
drupal-org-core.make. For example, it might look something like this:
api = 2
core = 7.x
projects[drupal][version] = 7.12
projects[drupal][patch] = http://drupal.org/files/issues/992540-3-reset_flood_limit_on_password_reset-drush.patch
projects[drupal][patch] = http://drupal.org/files/issues/object_conversion_menu_router_build-972536-1.patch
Step 4: Build it yourself
Although most potential errors will by caught by
drush verify-makefile, certain errors will only appear when you actually try to build the
.make file itself. The most obvious example of this is when the make file refers to patches that no longer apply. Even if they live on drupal.org (the requirement for including them in
drupal-org.make at all) you don't know if they apply until you have the code they're trying to patch. That requires actually building the make file, not just verifying the contents (which is all
verify-makefile can do).
So, you're going to want to run Drush Make like the Drupal.org packaging system does to make sure there aren't any final errors:
drush make --drupal-org drupal-org.make temp-directory
If you've got a
drupal-org-core.make file, you should try building that, too:
drush make --drupal-org=core drupal-org-core.make temp-core-directory
Step 5: Commit
Follow the instructions on your project page's "Version Control" tab to clone your Git repository. You'll need to add the
drupal-org.make file (and optionally the
drupal-org-core.make file if you need it) to the root directory:
git clone --branch 7.x-1.x [yourname]@git.drupal.org:project/[project].git
mv /path/to/drupal-org.make .
git add drupal-org.make
git commit -m "Drupal.org make file"
No copies of existing contributed projects should be checked in to the Git repository. As a profile maintainer, all you have to check in to Git is the drupal-org.make file, and the packaging script will automatically assemble core and all of the contrib modules and themes, external libraries, and patches it references when creating the downloadable file archives for a given release.
However, custom modules, features, and themes that are specific to the installation profile and not useful as stand-alone projects are managed differently. You can commit all profile-specific custom code to
themes/ directly inside the profile project's Git repository, and this will all show up at
/profiles/profile_name/themes/ when packaged with Drush make.
You can organize contrib and custom in subdirectories of
themes/ with any name you choose, such as
features, etc. For example, you can use
drupal-org.make attributes like
projects[views][subdir] = contrib which tell the packaging script to place contrib modules in
modules/contrib/. You can then directly commit custom modules to
modules/custom/ and custom features to
Step 6: Release
drupal-org.make file (and optionally any custom code and/or a
drupal-org-core.make file) is committed to the Git repository and pushed to git.drupal.org, create a release for your project in the typical way. The packaging system looks in a profile's main directory (the same directory your
.profile file is located) for the drupal-org.make file -- if it finds the file, then it will package the contents of the file with the profile.
// TODO: Screenshot of a fully packaged profile.
Step 7: Maintaining your distribution
Fixme: Add information about: Documentation. Support. Security/maintenance fixes.