Install Drupal with an installation profile #27

Closed
victorkane opened this Issue Dec 18, 2013 · 9 comments

Comments

Projects
None yet
1 participant
@victorkane
Owner

victorkane commented Dec 18, 2013

Why "everything in code"?

If everything we do is either part of the original installation profile or is added as a feature, then we are complying with "everything in code".

The "Drupal development, staging and production problem" and the solution as "everything in code" was pointed out years ago by visionary prophets:

This is why we favor Zen over the Adaptive and especially over Omega base themes (see #20 Choose base theme), which store the results of their GUI based configuration in the database together with content.

This is why Backdrop CMS with serializable JSON file based configuration will definitely be a wonderful upgrade path for Drupal 7 site builders seeking to avoid Drupal 8 complexity and the associated learning curve.

  • Referenced in Architecture Document as architectural decision

Installation profiles in Drupal 7

References

First cut solution

The standard Drupal install uses database writes to set configuration values.

Drupal Lean Process uses the Install Profile API for Drupal 6. For Drupal 7 we could take advantage of the module dependency to start the install off with the third party modules we want to include, doing the rest with features. So, clone the standard Drupal install, add third party modules and specify them in .info, then add more stuff with features, which should be added to the .info file as dependencies (they will have their own dependencies too).

Second cut

Resources:

I'm not keen on the idea of using drush make alone since I actually want the modules and any required patches under version control.

Profiler only downloaded a handful of times. Profiler Builder looks very promising. It's very active and growing in usage. What it does is take a functioning Drupal site and spit out an install profile for that site, which you can download as a tarball.

@victorkane

This comment has been minimized.

Show comment
Hide comment
@victorkane

victorkane Dec 18, 2013

Owner

Let's first try the method outlined here

to create an installation profile

The latest version will do the following for you:

Find all Modules, Themes, Libraries, and Patches in use and write them accurately to a make file (via a Site Builder UI)
Create a well made .info, .profile, and .install file
Package all of these up and give you a downloadable .tar file when you click Download
It has lots of documented hooks to make your own builds more accurate if there are settings that you know you want to remove. You can also bring settings back in that the module removes by default if you have reason to do so. It also comes with a Drush command that let's you take the current site and turn it into a install profile with a command like:

drush distro my_new_distro_name --untar

This will automatically add the site's install profile mapping and associated make file to profiles/my_new_distro_name as well as create best practice folders.

Tasks:

  • On a local dev branch Install Drupal with standard installation profile, including database in case of problems
  • Do basic configuration
  • Install recommended set of third-party modules
  • Initial test install profile generation and execution on fresh site, when successful merge to master
  • Create one or two features based on node types and views
  • Second test install profile generation and execution on fresh site, merge to master
  • #22 Create sub-theme for Zen (Zen Grids, Compass and Sass) and Adaptive
  • Generate install profile, test, merge to master
  • Install Panels and enable it together with Page Manager and get responsive panels with both Adaptive and Zen (!)
  • Test install profile by attempting to use it to clone site to a fresh installation
  • Optimize and re-test install profile
  • Clean up (remove database from git, etc)
  • Package and retest install profile
  • Merge into master

From then on, it's add features, wash, rinse, commit and push

Owner

victorkane commented Dec 18, 2013

Let's first try the method outlined here

to create an installation profile

The latest version will do the following for you:

Find all Modules, Themes, Libraries, and Patches in use and write them accurately to a make file (via a Site Builder UI)
Create a well made .info, .profile, and .install file
Package all of these up and give you a downloadable .tar file when you click Download
It has lots of documented hooks to make your own builds more accurate if there are settings that you know you want to remove. You can also bring settings back in that the module removes by default if you have reason to do so. It also comes with a Drush command that let's you take the current site and turn it into a install profile with a command like:

drush distro my_new_distro_name --untar

This will automatically add the site's install profile mapping and associated make file to profiles/my_new_distro_name as well as create best practice folders.

Tasks:

  • On a local dev branch Install Drupal with standard installation profile, including database in case of problems
  • Do basic configuration
  • Install recommended set of third-party modules
  • Initial test install profile generation and execution on fresh site, when successful merge to master
  • Create one or two features based on node types and views
  • Second test install profile generation and execution on fresh site, merge to master
  • #22 Create sub-theme for Zen (Zen Grids, Compass and Sass) and Adaptive
  • Generate install profile, test, merge to master
  • Install Panels and enable it together with Page Manager and get responsive panels with both Adaptive and Zen (!)
  • Test install profile by attempting to use it to clone site to a fresh installation
  • Optimize and re-test install profile
  • Clean up (remove database from git, etc)
  • Package and retest install profile
  • Merge into master

From then on, it's add features, wash, rinse, commit and push

@victorkane

This comment has been minimized.

Show comment
Hide comment
@victorkane

victorkane Dec 19, 2013

Owner

Created dev branch

lit@awebfactory:~/lit-dev$ git status
# On branch master
nothing to commit (working directory clean)
lit@awebfactory:~/lit-dev$ git branch -a
* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/gh-pages
  remotes/origin/master
lit@awebfactory:~/lit-dev$ git checkout -b dev-profile-builder
Switched to a new branch 'dev-profile-builder'
  • Created vanilla install
  • disabled these modules:
    • overlay
    • toolbar
    • dashboard
    • color

modules to install:
admin_menu advanced_help auto_nodetitle coder ctools date devel diff email
entity entityreference environment_indicator features globalredirect insert
libraries link media media_youtube menu_attributes module_filter moduleinfo
node_export pathauto realname rules strongarm token uuid views views_bulk_operations views_slideshow

Library example (views_slideshow)
tutorial for views_slideshow:
https://drupal.org/node/903244
https://github.com/malsup/cycle
http://jquery.malsup.com/cycle/
http://malsup.github.io/min/jquery.cycle.all.min.js <--
http://malsup.github.com/jquery.cycle.all.js

Enabled all modules

The Date API requires that you set up the site timezone and first day of week settings and the date format settings to function correctly.

Coder Review PHP_CodeSniffer not installed.
Coder review uses PHP_CodeSniffer to perform better code review checks; Code_Sniffer is not a requirement, but it is helpful. Use "drush install-php-code-sniffer" to help install.
fails
lit@awebfactory:~/lit-dev/docroot$ drush install-php-code-sniffer
pear install failed: ; Warning: lstat(): Lstat failed for [error]
/tmp/pear/cache/66dce4aec08ff0d500096db4e6799910rest.cacheid in
PEAR/REST.php on line 276; PHP Warning: lstat(): Lstat failed for
/tmp/pear/cache/66dce4aec08ff0d500096db4e6799910rest.cacheid in
/usr/share/php/PEAR/REST.php on line 276; No releases available for
package "pear.php.net/PHP_CodeSniffer"; install failed.
https://drupal.org/node/1716000

  • Deal with PHP_CodeSniffer (optional but recommended for Coder Review)
  • Install Panels and enable it together with Page Manager after creating Zen and Adaptive sub-themes
Owner

victorkane commented Dec 19, 2013

Created dev branch

lit@awebfactory:~/lit-dev$ git status
# On branch master
nothing to commit (working directory clean)
lit@awebfactory:~/lit-dev$ git branch -a
* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/gh-pages
  remotes/origin/master
lit@awebfactory:~/lit-dev$ git checkout -b dev-profile-builder
Switched to a new branch 'dev-profile-builder'
  • Created vanilla install
  • disabled these modules:
    • overlay
    • toolbar
    • dashboard
    • color

modules to install:
admin_menu advanced_help auto_nodetitle coder ctools date devel diff email
entity entityreference environment_indicator features globalredirect insert
libraries link media media_youtube menu_attributes module_filter moduleinfo
node_export pathauto realname rules strongarm token uuid views views_bulk_operations views_slideshow

Library example (views_slideshow)
tutorial for views_slideshow:
https://drupal.org/node/903244
https://github.com/malsup/cycle
http://jquery.malsup.com/cycle/
http://malsup.github.io/min/jquery.cycle.all.min.js <--
http://malsup.github.com/jquery.cycle.all.js

Enabled all modules

The Date API requires that you set up the site timezone and first day of week settings and the date format settings to function correctly.

Coder Review PHP_CodeSniffer not installed.
Coder review uses PHP_CodeSniffer to perform better code review checks; Code_Sniffer is not a requirement, but it is helpful. Use "drush install-php-code-sniffer" to help install.
fails
lit@awebfactory:~/lit-dev/docroot$ drush install-php-code-sniffer
pear install failed: ; Warning: lstat(): Lstat failed for [error]
/tmp/pear/cache/66dce4aec08ff0d500096db4e6799910rest.cacheid in
PEAR/REST.php on line 276; PHP Warning: lstat(): Lstat failed for
/tmp/pear/cache/66dce4aec08ff0d500096db4e6799910rest.cacheid in
/usr/share/php/PEAR/REST.php on line 276; No releases available for
package "pear.php.net/PHP_CodeSniffer"; install failed.
https://drupal.org/node/1716000

  • Deal with PHP_CodeSniffer (optional but recommended for Coder Review)
  • Install Panels and enable it together with Page Manager after creating Zen and Adaptive sub-themes

victorkane added a commit that referenced this issue Dec 19, 2013

@victorkane

This comment has been minimized.

Show comment
Hide comment
@victorkane

victorkane Dec 19, 2013

Owner

For initial install profile generation and testing, first installed module profiler builder:

lit@awebfactory:~/lit-dev/docroot$ drush dl profiler_builder
Project profiler_builder (7.x-1.0) downloaded to                     [success]
sites/all/modules/contrib/profiler_builder.
lit@awebfactory:~/lit-dev/docroot$ drush en profiler_builder
The following extensions will be enabled: profiler_builder
Do you really want to continue? (y/n): y
profiler_builder was enabled successfully.                           [ok]
profiler_builder defines the following permissions: administer profiler builder

Then to Administration » Configuration » Development » Profiler Builder
Entered "Literary Workshop" into short description field.
Left Exclusive, Left Dependencies, Clicked Variables, Left create admin role, Clicked Create defaults like standard profile, Left detected jquery.cycle librry detected.
Clicked on the Download Profile button
Would love to just do it with Drush, including the --untar option which places the profile in the profile folder; but no options can be specified, so gotta do it this way:

  • download lit_dev_opentimebook_com.tar
  • upload to server
  • commit local branch and backup just to be sure
  • zap database
  • checkout master
  • untar generated profile in profile folder
lit@awebfactory:~/lit-dev$ cd docroot/
lit@awebfactory:~/lit-dev/docroot$ cd profiles/
lit@awebfactory:~/lit-dev/docroot/profiles$ tar xvf ~/download/lit_dev_opentimebook_com.tar 
lit_dev_opentimebook_com/lit_dev_opentimebook_com.info
lit_dev_opentimebook_com/lit_dev_opentimebook_com.install
lit_dev_opentimebook_com/lit_dev_opentimebook_com.profile
lit_dev_opentimebook_com/drupal-org.make
lit_dev_opentimebook_com/local.make.example
lit@awebfactory:~/lit-dev/docroot/profiles$ ls
lit_dev_opentimebook_com  minimal  standard  testing
  • commit to master as very initial installation profile, push
  • make new test branch
  • test installation profile
Owner

victorkane commented Dec 19, 2013

For initial install profile generation and testing, first installed module profiler builder:

lit@awebfactory:~/lit-dev/docroot$ drush dl profiler_builder
Project profiler_builder (7.x-1.0) downloaded to                     [success]
sites/all/modules/contrib/profiler_builder.
lit@awebfactory:~/lit-dev/docroot$ drush en profiler_builder
The following extensions will be enabled: profiler_builder
Do you really want to continue? (y/n): y
profiler_builder was enabled successfully.                           [ok]
profiler_builder defines the following permissions: administer profiler builder

Then to Administration » Configuration » Development » Profiler Builder
Entered "Literary Workshop" into short description field.
Left Exclusive, Left Dependencies, Clicked Variables, Left create admin role, Clicked Create defaults like standard profile, Left detected jquery.cycle librry detected.
Clicked on the Download Profile button
Would love to just do it with Drush, including the --untar option which places the profile in the profile folder; but no options can be specified, so gotta do it this way:

  • download lit_dev_opentimebook_com.tar
  • upload to server
  • commit local branch and backup just to be sure
  • zap database
  • checkout master
  • untar generated profile in profile folder
lit@awebfactory:~/lit-dev$ cd docroot/
lit@awebfactory:~/lit-dev/docroot$ cd profiles/
lit@awebfactory:~/lit-dev/docroot/profiles$ tar xvf ~/download/lit_dev_opentimebook_com.tar 
lit_dev_opentimebook_com/lit_dev_opentimebook_com.info
lit_dev_opentimebook_com/lit_dev_opentimebook_com.install
lit_dev_opentimebook_com/lit_dev_opentimebook_com.profile
lit_dev_opentimebook_com/drupal-org.make
lit_dev_opentimebook_com/local.make.example
lit@awebfactory:~/lit-dev/docroot/profiles$ ls
lit_dev_opentimebook_com  minimal  standard  testing
  • commit to master as very initial installation profile, push
  • make new test branch
  • test installation profile
@victorkane

This comment has been minimized.

Show comment
Hide comment
@victorkane

victorkane Dec 20, 2013

Owner

The profile is chosen by default (because the Exclusive option was checked on the profile generation page) at the Url http://lit-dev.opentimebook.com/install.php?profile=lit_dev_opentimebook_com
Once you choose language and click Save and continue, you get the following error, at Url http://lit-dev.opentimebook.com/install.php?profile=lit_dev_opentimebook_com&locale=en:

Required modules    Required modules not found.
The following modules are required but were not found. Move them into the appropriate modules subdirectory, such as sites/all/modules. Missing modules: Admin_menu, Admin_menu_toolbar, Module_filter, Ctools, Views_content, Date, Date_api, Date_popup, Date_views, Email, Entityreference, Link, File_entity, Media, Media_internet, Media_youtube, Node_export, Node_export_features, Advanced_help, Auto_nodetitle, Diff, Entity, Entity_token, Environment_indicator, Libraries, Menu_attributes, Pathauto, Realname, Strongarm, Token, Globalredirect, Rules, Rules_admin, Uuid, Views, Views_bulk_operations, Views_slideshow, Views_slideshow_cycle, Views_ui, Features

Drush make is not getting executed evidently. The install profile is generated for http://drupal.org, where the packaging system includes the necessary modules to be downloaded.

Going back to How to Create a Drupal Installation Profile with Profiler and Profiler Builder, the Screencast: Turning your current site into a distribution with Profiler Builder (1/29/2013) explains how to run the drush make file to get the new site, and how to add in the profile to the profiles folders, to obtain the fresh new Drupal instance for your install profile.

Owner

victorkane commented Dec 20, 2013

The profile is chosen by default (because the Exclusive option was checked on the profile generation page) at the Url http://lit-dev.opentimebook.com/install.php?profile=lit_dev_opentimebook_com
Once you choose language and click Save and continue, you get the following error, at Url http://lit-dev.opentimebook.com/install.php?profile=lit_dev_opentimebook_com&locale=en:

Required modules    Required modules not found.
The following modules are required but were not found. Move them into the appropriate modules subdirectory, such as sites/all/modules. Missing modules: Admin_menu, Admin_menu_toolbar, Module_filter, Ctools, Views_content, Date, Date_api, Date_popup, Date_views, Email, Entityreference, Link, File_entity, Media, Media_internet, Media_youtube, Node_export, Node_export_features, Advanced_help, Auto_nodetitle, Diff, Entity, Entity_token, Environment_indicator, Libraries, Menu_attributes, Pathauto, Realname, Strongarm, Token, Globalredirect, Rules, Rules_admin, Uuid, Views, Views_bulk_operations, Views_slideshow, Views_slideshow_cycle, Views_ui, Features

Drush make is not getting executed evidently. The install profile is generated for http://drupal.org, where the packaging system includes the necessary modules to be downloaded.

Going back to How to Create a Drupal Installation Profile with Profiler and Profiler Builder, the Screencast: Turning your current site into a distribution with Profiler Builder (1/29/2013) explains how to run the drush make file to get the new site, and how to add in the profile to the profiles folders, to obtain the fresh new Drupal instance for your install profile.

@victorkane

This comment has been minimized.

Show comment
Hide comment
@victorkane

victorkane Dec 20, 2013

Owner

Listed on the same resource page: Screencast: Using Drush with this package and what it does (10/25/2012)

On any existing Drupal site:

$ drush dl profiler_builder
$ drush en profiler_builder
$ drush distro catchy_distro_name
Wrote .tar file catchy_distro_name.tar to current directory

This just creates the tar file as before, except in the current directory instead of having to download and upload it to server. However, if we do:

$ drush distro catchy_distro_name --untar
Profile catchy_distro_name created successfully!

It didn't create a tar file, it actually added the profile to the profiles directory, and included best practices folders. Full action:

lit@awebfactory:~/lit-dev/docroot$ ls profiles/
minimal  standard  testing
lit@awebfactory:~/lit-dev/docroot$ drush distro lit-drupal-lean --untar
Profile lit-drupal-lean created successfully!                        [ok]
lit@awebfactory:~/lit-dev/docroot$ tree profiles/lit-drupal-lean/
profiles/lit-drupal-lean/
├── drupal-org.make
├── libraries
├── lit-drupal-lean.info
├── lit-drupal-lean.install
├── lit-drupal-lean.profile
├── local.make.example
├── modules
│   ├── contrib
│   ├── custom
│   └── lit-drupal-lean_features
└── themes
    ├── contrib
    └── custom

8 directories, 5 files
lit@awebfactory:~/lit-dev/docroot$ 

But wait, why not just leave the modules and libraries where they are? This would be a much better fit for development, in order to package a delivery, you can simply generate the install profile and commit (settings.php is not versioned, nor is files/, nor is the database. So if someone checked out the result, they would just install the site. With node_import's support for content in features, you could even include a starter set of content! Or legacy content.

Would the install work? To find out I would simply:

  • Zap the database
  • Zap settings.php by copying over a fresh one from default.settings.php
  • Zap the contents of the files directory
  • Install Drupal!

Let's do it!

So, we get automatic selection at http://lit-dev.opentimebook.com/install.php?profile=lit-drupal-lean but when we hit Save and continue we get the arcane message Sorry, the profile you have chosen cannot be loaded. at http://lit-dev.opentimebook.com/install.php?profile=litdrupallean&locale=en

According to https://drupal.org/node/1075012 it is because the profile name does not match the directory. I guess it's a bad idea to use dashes :)

Doing it again, we now get a WSOD, from /var/log/apache2/error.log we get:

[Fri Dec 20 13:39:04 2013] [error] [client 186.19.62.253] PHP Fatal error:  require_once(): Failed opening required 'libraries/profiler/profiler.inc' (include_path='.:/usr/share/php:/usr/share/pear') in /home/lit/lit-dev/docroot/profiles/lit/lit.install on line 2

This is actually covered in issue https://drupal.org/node/2015431 So maybe will work in next stable version.

The offending lines are the first two in lit.install:

 !function_exists('profiler_v2') ? require_once('libraries/profiler/profiler.inc') : FALSE;
  profiler_v2('myprofile');

Erased those and the installer worked like a charm.

New site up.

Now, Profiler Rebuilder is present, of course, but not enabled.

I re-created the install profile directly with drush, then erased the two lines.

Will merge into master and test

Owner

victorkane commented Dec 20, 2013

Listed on the same resource page: Screencast: Using Drush with this package and what it does (10/25/2012)

On any existing Drupal site:

$ drush dl profiler_builder
$ drush en profiler_builder
$ drush distro catchy_distro_name
Wrote .tar file catchy_distro_name.tar to current directory

This just creates the tar file as before, except in the current directory instead of having to download and upload it to server. However, if we do:

$ drush distro catchy_distro_name --untar
Profile catchy_distro_name created successfully!

It didn't create a tar file, it actually added the profile to the profiles directory, and included best practices folders. Full action:

lit@awebfactory:~/lit-dev/docroot$ ls profiles/
minimal  standard  testing
lit@awebfactory:~/lit-dev/docroot$ drush distro lit-drupal-lean --untar
Profile lit-drupal-lean created successfully!                        [ok]
lit@awebfactory:~/lit-dev/docroot$ tree profiles/lit-drupal-lean/
profiles/lit-drupal-lean/
├── drupal-org.make
├── libraries
├── lit-drupal-lean.info
├── lit-drupal-lean.install
├── lit-drupal-lean.profile
├── local.make.example
├── modules
│   ├── contrib
│   ├── custom
│   └── lit-drupal-lean_features
└── themes
    ├── contrib
    └── custom

8 directories, 5 files
lit@awebfactory:~/lit-dev/docroot$ 

But wait, why not just leave the modules and libraries where they are? This would be a much better fit for development, in order to package a delivery, you can simply generate the install profile and commit (settings.php is not versioned, nor is files/, nor is the database. So if someone checked out the result, they would just install the site. With node_import's support for content in features, you could even include a starter set of content! Or legacy content.

Would the install work? To find out I would simply:

  • Zap the database
  • Zap settings.php by copying over a fresh one from default.settings.php
  • Zap the contents of the files directory
  • Install Drupal!

Let's do it!

So, we get automatic selection at http://lit-dev.opentimebook.com/install.php?profile=lit-drupal-lean but when we hit Save and continue we get the arcane message Sorry, the profile you have chosen cannot be loaded. at http://lit-dev.opentimebook.com/install.php?profile=litdrupallean&locale=en

According to https://drupal.org/node/1075012 it is because the profile name does not match the directory. I guess it's a bad idea to use dashes :)

Doing it again, we now get a WSOD, from /var/log/apache2/error.log we get:

[Fri Dec 20 13:39:04 2013] [error] [client 186.19.62.253] PHP Fatal error:  require_once(): Failed opening required 'libraries/profiler/profiler.inc' (include_path='.:/usr/share/php:/usr/share/pear') in /home/lit/lit-dev/docroot/profiles/lit/lit.install on line 2

This is actually covered in issue https://drupal.org/node/2015431 So maybe will work in next stable version.

The offending lines are the first two in lit.install:

 !function_exists('profiler_v2') ? require_once('libraries/profiler/profiler.inc') : FALSE;
  profiler_v2('myprofile');

Erased those and the installer worked like a charm.

New site up.

Now, Profiler Rebuilder is present, of course, but not enabled.

I re-created the install profile directly with drush, then erased the two lines.

Will merge into master and test

@victorkane

This comment has been minimized.

Show comment
Hide comment
@victorkane

victorkane Dec 20, 2013

Owner

A little script to zap a site so you can go ahead and run an install profile:

$ cat scripts/zapsite.sh
# 
# Prepare Drupal instance for interactive installation
# Execute from document root (may need sudo)

# Zap the database
# http://drush.ws/ shows sql-drop!
drush sql-drop

# Zap settings.php by copying over a fresh one from default.settings.php
cp sites/default/default.settings.php sites/default/settings.php 

# Zap the contents of the files directory
rm -rf sites/default/files/*
rm -f sites/default/files/.htaccess
chown www-data sites/default/files sites/default/settings.php

# Ready to Install Drupal!
echo "Go ahead and install Drupal!\n"lit@awebfactory:~/lit-dev$ cd docroot

Go to docroot and run it

$ cd docroot
$ ../scripts/zapsite.sh 
Do you really want to drop all tables in the database lit_dev01? (y/n): y

Go ahead and install Drupal!
Owner

victorkane commented Dec 20, 2013

A little script to zap a site so you can go ahead and run an install profile:

$ cat scripts/zapsite.sh
# 
# Prepare Drupal instance for interactive installation
# Execute from document root (may need sudo)

# Zap the database
# http://drush.ws/ shows sql-drop!
drush sql-drop

# Zap settings.php by copying over a fresh one from default.settings.php
cp sites/default/default.settings.php sites/default/settings.php 

# Zap the contents of the files directory
rm -rf sites/default/files/*
rm -f sites/default/files/.htaccess
chown www-data sites/default/files sites/default/settings.php

# Ready to Install Drupal!
echo "Go ahead and install Drupal!\n"lit@awebfactory:~/lit-dev$ cd docroot

Go to docroot and run it

$ cd docroot
$ ../scripts/zapsite.sh 
Do you really want to drop all tables in the database lit_dev01? (y/n): y

Go ahead and install Drupal!
@victorkane

This comment has been minimized.

Show comment
Hide comment
@victorkane

victorkane Dec 21, 2013

Owner

Procedure to re-create install profile

lit@awebfactory:~/lit-dev/docroot$ ls profiles/
lit  minimal  standard  testing
lit@awebfactory:~/lit-dev/docroot$ rm -rf profiles/lit

lit@awebfactory:~/lit-dev/docroot$ drush dl profiler_builder
Install location sites/all/modules/contrib/profiler_builder already exists. Do you want to overwrite it? (y/n): 
y
Project profiler_builder (7.x-1.0) downloaded to sites/all/modules/contrib/profiler_builder.         [success]
lit@awebfactory:~/lit-dev/docroot$ drush en profiler_builder
The following extensions will be enabled: profiler_builder
Do you really want to continue? (y/n): y
profiler_builder was enabled successfully.                                                           [ok]
profiler_builder defines the following permissions: administer profiler builder
lit@awebfactory:~/lit-dev/docroot$ drush distro lit --untar
Profile lit created successfully!                                                                    [ok]

Comment out offending code in lit.install

/* 
 * Commenting out these two lines according to https://github.com/victorkane/lit-drupal-lean/issues/issue/27
 *  !function_exists('profiler_v2') ? require_once('libraries/profiler/profiler.inc') : FALSE;
 * profiler_v2('lit');
 */

Test this by doing:

lit@awebfactory:~/lit-dev/docroot$ head profiles/lit/lit.install 
<?php
/*
 * Commenting out these two lines according to https://github.com/victorkane/lit-drupal-lean/issues/issue/27
 *  !function_exists('profiler_v2') ? require_once('libraries/profiler/profiler.inc') : FALSE;
 * profiler_v2('lit');
*/
/**
 * Implements hook_install().
 *
 * Perform actions to set up the site for this profile.
...
Owner

victorkane commented Dec 21, 2013

Procedure to re-create install profile

lit@awebfactory:~/lit-dev/docroot$ ls profiles/
lit  minimal  standard  testing
lit@awebfactory:~/lit-dev/docroot$ rm -rf profiles/lit

lit@awebfactory:~/lit-dev/docroot$ drush dl profiler_builder
Install location sites/all/modules/contrib/profiler_builder already exists. Do you want to overwrite it? (y/n): 
y
Project profiler_builder (7.x-1.0) downloaded to sites/all/modules/contrib/profiler_builder.         [success]
lit@awebfactory:~/lit-dev/docroot$ drush en profiler_builder
The following extensions will be enabled: profiler_builder
Do you really want to continue? (y/n): y
profiler_builder was enabled successfully.                                                           [ok]
profiler_builder defines the following permissions: administer profiler builder
lit@awebfactory:~/lit-dev/docroot$ drush distro lit --untar
Profile lit created successfully!                                                                    [ok]

Comment out offending code in lit.install

/* 
 * Commenting out these two lines according to https://github.com/victorkane/lit-drupal-lean/issues/issue/27
 *  !function_exists('profiler_v2') ? require_once('libraries/profiler/profiler.inc') : FALSE;
 * profiler_v2('lit');
 */

Test this by doing:

lit@awebfactory:~/lit-dev/docroot$ head profiles/lit/lit.install 
<?php
/*
 * Commenting out these two lines according to https://github.com/victorkane/lit-drupal-lean/issues/issue/27
 *  !function_exists('profiler_v2') ? require_once('libraries/profiler/profiler.inc') : FALSE;
 * profiler_v2('lit');
*/
/**
 * Implements hook_install().
 *
 * Perform actions to set up the site for this profile.
...
@victorkane

This comment has been minimized.

Show comment
Hide comment
@victorkane

victorkane Dec 29, 2013

Owner

When the number of features is large, install profile cannot handle dependencies very well, and some stuff doesn't get reverted by the install process no matter what you do.

So it's best to have the install profile install all the basic architecture and perform the initial configuration, including the enabling of a few base features; and then manually enable the desired app level feature set manually after installation is complete, either from the gui or from the drush command line (revert), choosing from among all the options made available via version control.

This makes for two separate phases for the development workflow. The first perfects the install profile and the base features. Once these are thoroughly tested, there is no need to continue re-installing the site from scratch every time you test something new. A simple revert for the features being tested should suffice for user story level testing (not for regression or integration testing).

A special mention should be made of node export default content. Content is imported upon enabling the feature, and then again and again every time you revert it. So it's best to not have any other components than node export features in the default content features, and just have them reverted once by the install process.

Some of the paths to be taken in Drupal Lean Process LTS include using panels with adaptive and zen themes, and perhaps other kinds of page managers were they to become available (i.e. with Backdrop CMS). So this particular instance, Lit Drupal Lean, will be using a zen sub-theme with Context module driven layout management (via block management only, not via context layout module which requires special outmoded themes).

Owner

victorkane commented Dec 29, 2013

When the number of features is large, install profile cannot handle dependencies very well, and some stuff doesn't get reverted by the install process no matter what you do.

So it's best to have the install profile install all the basic architecture and perform the initial configuration, including the enabling of a few base features; and then manually enable the desired app level feature set manually after installation is complete, either from the gui or from the drush command line (revert), choosing from among all the options made available via version control.

This makes for two separate phases for the development workflow. The first perfects the install profile and the base features. Once these are thoroughly tested, there is no need to continue re-installing the site from scratch every time you test something new. A simple revert for the features being tested should suffice for user story level testing (not for regression or integration testing).

A special mention should be made of node export default content. Content is imported upon enabling the feature, and then again and again every time you revert it. So it's best to not have any other components than node export features in the default content features, and just have them reverted once by the install process.

Some of the paths to be taken in Drupal Lean Process LTS include using panels with adaptive and zen themes, and perhaps other kinds of page managers were they to become available (i.e. with Backdrop CMS). So this particular instance, Lit Drupal Lean, will be using a zen sub-theme with Context module driven layout management (via block management only, not via context layout module which requires special outmoded themes).

victorkane added a commit that referenced this issue Dec 30, 2013

Literary Workshop built on Drupal Lean Process LTS for the long haul;…
… Zen sub-theme; blocks with context management; distinct install profile + base features, then features based development phases; for #27
@victorkane

This comment has been minimized.

Show comment
Hide comment
@victorkane

victorkane Jan 6, 2014

Owner

We have seen the importance of CTools exporting a whole group of features to a module, almost like features.
See also https://drupal.org/project/drush_ctex_bonus for a host of options to beef up Bulk export options.

Owner

victorkane commented Jan 6, 2014

We have seen the importance of CTools exporting a whole group of features to a module, almost like features.
See also https://drupal.org/project/drush_ctex_bonus for a host of options to beef up Bulk export options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment