So it seems I can coerce drush_make into downloading those evil other CMSes we love so much:
core = 6.x
api = 2
projects[drupal][download][type] = "get"
projects[drupal][download][url] = "http://wordpress.org/latest.tar.gz"
As insane as this looks, this actually works:
$ drush make ~/alien.make
Make new site in the current directory? (y/n): y
Project information for drupal retrieved. [ok]
drupal downloaded from http://wordpress.org/latest.tar.gz. [ok]
$ ls
index.php wp-app.php wp-config-sample.php wp-links-opml.php wp-rdf.php wp-signup.php
license.txt wp-atom.php wp-content wp-load.php wp-register.php wp-trackback.php
readme.html wp-blog-header.php wp-cron.php wp-login.php wp-rss2.php xmlrpc.php
wp-activate.php wp-comments-post.php wp-feed.php wp-mail.php wp-rss.php
wp-admin wp-commentsrss2.php wp-includes wp-pass.php wp-settings.php
Call me crazy, but even though this is probably not a desired effect, I feel this is actually a nice feature to have, especially for Aegir, which is more and more based on drush make. If we want to support other "platforms" than Drupal, then Drush make could help us big time!
So I feel that while this works, a couple of improvements could be done here. In a few steps:
1. change those notices to read "wordpress" instead of Drupal (ie. support other cores)
2. allow overriding the default upstream repositories for different "cores"
3. allow download and install of extensions for other "cores"
Let's take this one at a time.
Supporting another core type
This is the key idea here. I think that this should be fairly easy to do, but maybe hard to do *right*. Basically, I think the makefile should look something like this instead:
version = 3.x
api = 2
type = wordpress
projects[wordpress][download][type] = "get"
projects[wordpress][download][url] = "http://wordpress.org/latest.tar.gz"
That way the messages would be showed right. Note that this would also add support for Drupal distributions that do not sit on Drupal.org (even though we don't like that).
Changes necessary here:
* parse the type option in the makefile (of course defaulting to "drupal" if not present)
* look for projects[$type] instead of projects[drupal] in the makefile
* change all occurrences of "drupal" in the messages and codebase to "$type"
* support the new "version" parameter (optional, core remains as backward-compatibility deprecated shim) - idea is to remove the confusion between core and type
allowing upstream urls overrides
This is a tad more complicated, and less a priority, because it can be done by manually entering the right URLs in subprojects. *But*, if we parametrize the core type, then we can call different hooks based on that type, and third party extensions to drush can implement their own ways of telling what is "the latest version url". If this is done right, we could have a much simpler makefile:
version = 3.x
api = 2
type = wordpress
.. and the hooks would look on wordpress.org (or wherever) to find what is the latest version.
Changes necessary:
* wrap the current update.drupal.org logic behind hooks
* call those hooks, based on the type
* define another hook, as an example
I'm really worried about the first step here. :)
downloading extensions for other cores
Then the ultimate achievement is to extend those hooks again to allow downloading of third party modules. To again take the example of wordpress, this could look like:
version = 3.x
api = 2
type = wordpress
projects[] = "buddypress"
... which would download buddypress in the right place.
Changes necessary:
* wrap the current logic to find where to put modules ("sites/all or sites/foo?") behind hooks
* wrap the current update.drupal.org logic to find modules behind hooks (maybe the same as step 2)
* call those properly
Conclusion
While this is an ambitious project, I don't expect a lot of people outside the aegir community to have an interest for this, so I am not going to push this very hard, and could settle for just step 1. :) However with this, Drush make could grow to a very versatile deployment tool that would be cross-VCS *and* cross-CMS.
Comments
Comment #1
dmitrig01 CreditAttribution: dmitrig01 commentedyou evildo-er :P
Anyway, this is an interesting idea, and I'm interested in pursuing this.
We do support core projects that are non-drupal - all we care about is that the projects have a [type] = core - this would work:
The reason using the key "drupal" works as well is because drush make needs two key pieces of information to make a project: the download and the type. You provided it with the download information so it didn't need to go find that, but it couldn't figure out the type of core, so it went to drupal.org's updatexml and determined the fact that it is drupal core ("Project information for drupal retrieved" means it fetched the data from updatexml, and if you use the makefile above, I don't think it will display that message).
The same syntax as above can be used for downloading pressflow.
Your "type = wordpress" is an interesting idea but a bit inflexible. What if I wanted to install wordpress plugins in drupal? :D (or, more likely, themes, see http://drupal.org/project/wp_theme).
The sites/all and the contrib-destination in general are hardcoding hacks, and while I don't plan to address those before getting a 2.0 release out the door, this is something that we could aim for in a 3.x release.
Comment #2
dmitrig01 CreditAttribution: dmitrig01 commentedBTW for the mixed drupal/wordpress we may want to use a syntax like http://drupal.org/node/911722#comment-3697118
Comment #3
anarcat CreditAttribution: anarcat commentedAlright, so it seems case #1 is completely covered here (although it could use documentation in the README)...
I see how #2 and #3 could be covered by #911722: Default path for projects, libraries, which are in general a nice idea, I think...
So basically all that is left here is to override the sites/all and contrib destinations.
Thanks a lot for the feedback, I never cease to be amazed by how wonderful drush make is. :)
Comment #4
dmitrig01 CreditAttribution: dmitrig01 commented#911722: Default path for projects, libraries - thanks for the kind words, and I think the work you're doing (wordpress w/ drush make? who would have thought!) is incredibly cool as well.