Posted by greg.1.anderson on December 12, 2011 at 8:20am
28 followers
| Project: | Drush |
| Component: | Make |
| Category: | feature request |
| Priority: | normal |
| Assigned: | greg.1.anderson |
| Status: | needs work |
Issue Summary
Once we can generate makefiles, our next desire is to be able to generate "starter" installation profiles from existing Drupal sites. Perhaps this will not be able to produce a clone of the selected site, but it should be possible to take a lot of the rote work out of starting up a new profile.
The attached patch is a proof of concept. It does generate installation profiles for the selected Drupal site, but so far I have not tested the output (e.g. with drush site-install).
| Attachment | Size |
|---|---|
| generate-profile.patch | 5.73 KB |
Comments
#2
Here is an update that improves on the proof of concept. It is still unfinished, however; the .install and .profile files it generates are untested. After some post-production hand-editing, the output might be useful.
#3
This is a pretty large command. I'm inclined to skip it for drush5 and consider for 6. Am willing to discuss it though.
#4
It could go in its own module, like site-upgrade, if it's too large for core. (Maybe taking generate-make with it?) Since it's a new command, it would not break backwards compatibility to put it in 6 and backport to 5 if it does not make it in for Drush-5 stable.
#5
Let's postpone this for Drush 6, or move it into its own contrib module.
#6
I agree that this should not be committed until after Drush-5 stable goes out. I'm interested in seeing this stay with generate-make, and would prefer to see both stay in core, but am flexible.
#7
Here is my latest work-in-progress on this code. The installation profiles I have generated with this produce working profiles that will install a D7 site. Templates for D6 not available yet.
Also included in this patch is an experimental feature that tries to recover the URL to external libraries from a lookup table. I am uncertain about this, however; at a minimum, the lookup table should not live with the Drush code.
#8
This version sorts the dependency list in the .info file into core, contrib and custom extensions.
#9
Really really great job!
Perhaps we should furthermore write down, what's the purpose of this feature:
- 1:1 Copy of the existing page to install using the installer?
- What are the main problems and how could they be solved? (Libraries, SQL Dumps, other Hardware, ...)
- What should (NOT) be included?
- Configuration options?
This might help in further development. What do you think?
PS: Perhaps this module might give some hints or is worth a combination:
http://drupal.org/project/profiler
#10
Looks really useful, but haven't used this type of thing enough to have a clear idea of what I can expect it to do. Currently:
a) Work on custom D7 sites, & find that I am often making similar installs, so if I could generate a site profile automatically using this tool, it would be really great.
b) Looks like there are 7.x versions of Profiler & some other modules. I'm willing to be a guinea-pig for these efforts, just so long as I have a clearer understanding of what can/should be done with your patch.
Thanks for any clarifications/suggestions
#11
Yes, you pretty much have the right idea. Regarding the comments in #9, generate profile does not currently attempt to handle generation of configuration code. If you generate modules that capture your site's configuration, for example using features or ctools export bonus, then those modules will become part of your generated profile when you run the generate-profile command. I do not think that generate profile should try to duplicate the functionality of these modules, but it might be interesting to add options to automatically call ctools export bonus to record settings, if it is available.
I'm undecided about the value of profiler. The generate-profile command currently is not good at writing a profile for a site that was generated from a profile. It could be adapted to create a theme that was based on profiler, if decided; this should only be done on request (e.g. via a commandline option).
#12
Create a theme:
I notice that in the Profiler, there is reference made to being able to specify a theme, but I don't see it as a part of the Profiler Example file. I'll play around with it more, but being able to detect/specify themes to be used in a profile would be a big win. With a "custom theme" option, you might be able to include custom themes in the profile, if you could pick up the 'theme.info' file for it
#13
Related blog post: http://davehall.com.au/blog/dave/2012/09/09/managing-project-installatio...
Sets the theme and configures some blocks. This could probably be done for generate-profile based on the theme and blocks defined in the current site.