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).

Comments

greg.1.anderson’s picture

StatusFileSize
new21.71 KB

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.

moshe weitzman’s picture

This is a pretty large command. I'm inclined to skip it for drush5 and consider for 6. Am willing to discuss it though.

greg.1.anderson’s picture

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.

jhedstrom’s picture

Status: Needs work » Postponed

Let's postpone this for Drush 6, or move it into its own contrib module.

greg.1.anderson’s picture

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.

greg.1.anderson’s picture

Assigned: Unassigned » greg.1.anderson
Status: Postponed » Needs work
StatusFileSize
new32.16 KB

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.

greg.1.anderson’s picture

StatusFileSize
new32.14 KB

This version sorts the dependency list in the .info file into core, contrib and custom extensions.

anybody’s picture

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

fejn’s picture

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

greg.1.anderson’s picture

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).

fejn’s picture

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

greg.1.anderson’s picture

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.

greg.1.anderson’s picture

Version: » 8.x-6.x-dev
Status: Needs work » Closed (won't fix)
Issue tags: +Needs migration

This issue was marked closed (won't fix) because Drush has moved to Github.

If this feature is still desired, you may copy it to our Github project. For best results, create a Pull Request that has been updated for the master branch. Post a link here to the PR, and please also change the status of this issue to closed (duplicate).

Please ask support questions on Drupal Answers.

joachim’s picture

This could go in Module Builder.

greg.1.anderson’s picture

Project: Drush » Module Builder
Version: 8.x-6.x-dev » 7.x-2.x-dev
Component: Make » Code
Assigned: greg.1.anderson » Unassigned
Status: Closed (won't fix) » Active
Issue tags: -Needs migration

Moving to module builder, for future consideration there. The code generator used here is similar to, yet different than the one in module builder. I'm not sure if it would be best to leave them separate, or merge them together.

I haven't worked on this for a long time. The patch in #8 worked fine for Drupal 7.x profiles, but needs updating for Drupal 6.x (and 8.x). There may be need for some other enhancements as well, as things may have changed in Drush. I don't think so, though.

joachim’s picture

Issue tags: +Needs migration

Quickest thing would be to create a new Module builder generator for Profiles, that would either wrap around yours, or just have yours as its methods.

We can always think about ways to harmonize it and make it reuse parts of MB later on.

greg.1.anderson’s picture

Cool. I can work on this + drushify integration sometime after Prague -- no time to do it before.

milos.kroulik’s picture

Issue summary: View changes

Do you still plan to work on this issue?

greg.1.anderson’s picture

It's not really on my roadmap right now, although I am in theory still interested in it. I am kind of moving away from Drush make, though, so if I did pick this up again, the first thing I would want to do is consider how it might be useful with composer-generate.

It would be great if someone else wanted to pick this up, though.

joachim’s picture

There is a profile generator in Module Builder that I added a while back. It's pretty basic so far -- it just creates the .profile and the .install files, so it would need fleshing out.