3

I am building a multisite and each sub-site may have its own contrib modules.

For example: sites/all/modules/contrib/entity sites/site1/modules/contrib/views sites/site2/modules/contrib/services

I build a makefile for the shared modules:

api = 2
core = 7.x
projects[entity][] = ""

And one makefile per subsite which includes the global makefile:

includes[] = "make.yml"
projects[views][] = ""

The inclusion works properly but I can't get the modules being downloaded in different directories.

I try to run the drush make command with --contrib-destination=sites option, add defaults[projects][subdir] = all/modules/contrib in the global makefile and to specify a subdir for each sub-sites's specific module projects[views][subdir] = "sites1/modules/contrib". No luck, the modules are downloaded in sites/modules/all/modules/contrib and sites/modules/site1/modules/contrib instead.

Is there any way to get it working? I now think to add some custom code to a script to run after the drush make command to move specific modules to proper directory.

Thanks,

2

By checking the drush code itself, we discovered the possibility to add contrib_destination on specific project level.

projects[views][] = ""
projects[views][contrib_destination] = "sites/site1"

However, as it would had quite a lot of lines to the makefile (we must add the contrib_destination line to all modules used by site1 only) we decided to not use the includes feature and to keep to separate makefiles.

To build our docroot, we then have one "global" makefile to prepare the sites/all modules and another ones for each subsites (sites/site1). Then we launch the drush make command for each makefile (using a shell wrapper to handle it).

This is not perfect and would probably be easier to have something build-in (I don't know what would be the best syntax for that).

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.