Drupid
Drush Makefile Drupal
What is it?
Drupid is a better replacement for Drush's drush make
. Drupid does not only build a Drupal platform based on a makefile: it synchronizes a Drupal's platform with a makefile!
Drupid is not a clever guy after all. It basically does only three things:
- synchronizes a site with a makefile;
- helps you create patches easily;
- generates dependency graphs.
Drupid is not meant to be a replacement for Drush in its entirety. Rather, Drupid just provides a simpler and more efficient way of managing the code of your Drupal sites by exploiting makefiles the way they should.
Ah, and Drupid supports installation profiles and multisite, too!
Drupid is open-source free software distributed under the MIT license.
Installation
gem install drupid
Requirements
curl
, git
, mktemp
, patch
, rsync
…and, well, Ruby!
Optional (recommended)
dot
(graphviz
), drush
Compatibility
- Ruby: 1.8.7, 1.9, 2.0
- Drupal: 6.x, 7.x, 8.x*
- Drush: 6, 7
*Under development
Synchronization
The most fundamental Drupid command is
drupid -s mysite.make -p mysite
where mysite.make
is a Drush makefile and mysite
is the path to a Drupal site. Drupid compares the current status of mysite
with its specification (the makefile) and tries to fix all the differences. Drupid can:
- download and install missing projects and libraries;
- update projects and libraries, including Drupal core;
- resolve all project dependencies;
- apply patches;
- move projects to a different directory;
- verify the integrity of the code.
- delete unused projects and libraries.
Drupid always preflights all the changes that should be applied so that, if a problem occurs, your site is not modified in any way.
Most important options:
-c
,--no-core
: do not synchronize Drupal core.-d
,--no-deps
: do not automatically follow dependencies.-l
,--no-libs
: do not synchronize external libraries.-n
,--dry
: preflight changes, but do not apply them.-f
,--force
: apply changes even if there are errors.-S
,--site
: (for multisite platforms) specify the site to be synchronized.-u
,--updatedb
: update the site's database after a successful synchronization. This option requires Drush to be installed to take effect.
Note that Drupid can also be used to build Drupal platforms from scratch: just pass to -p
a non-existing path.
Patches
Drupid greatly simplifies the process of creating patches for any project. For example:
drupid --edit drupal-8.x drupid --edit media-7.x-1.2 drupid --edit http://codemirror.net/codemirror.zip
Drupid downloads a pristine copy of the specified project in a temporary directory, creates a temporary Git repository, and opens an interactive shell. From there, you may make any changes you wish, using the method you prefer. When you are done, just exit the shell. Puff, the patch will be printed to the standard output. Or you can use --out
to specify an output file.
If the project you want to patch already exists locally, just do:
cd path/to/myproject drupid --edit
Dependency graphs
Sometimes, you may wonder why Drupid has retrieved a given project when there is no trace of it in the makefile. Sure, it's to meet some dependency. To discover which one, or just to take a look at the relationships among the various modules and themes, you may draw a dependency graph from your platform:
drupid --graph -p mysite
The result is an SVG image, which you can open in any modern browser. And the names of the projects will be searchable!
Known Issues
- Drupid can only synchronize local sites.
- Drupid parses, but ignores, version constraints in makefiles.
- Drupid is not yet compatible with Drupal 8.
For bug reports and feature requests, create a Github issue.
Resources
- An Introduction to Drupid (a five minute screencast)
- Drush Make Generator