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.
gem install drupid
…and, well, Ruby!
- Ruby: 1.8.7, 1.9, 2.0
- Drupal: 6.x, 7.x, 8.x*
- Drush: 6, 7
The most fundamental Drupid command is
drupid -s mysite.make -p mysite
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:
--no-core: do not synchronize Drupal core.
--no-deps: do not automatically follow dependencies.
--no-libs: do not synchronize external libraries.
--dry: preflight changes, but do not apply them.
--force: apply changes even if there are errors.
--site: (for multisite platforms) specify the site to be synchronized.
--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.
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
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!
- 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.