Environment Makefile

Sandbox

Environment Makefile Sandbox

Git Clone Instructions

git clone --branch 7.x-1.x http://git.drupal.org/sandbox/jdillick/2313227.git environment_makefile
cd environment_makefile

Environment makefile allows you to auto-enable or disable modules based on your site's makefile and environment. This would allow you to specify development modules such as devel, or production-only modules such as production monitor in one makefile that will be enabled or disabled when you run Drush.

Requirements

  • Drupal 7.x
  • PHP 5.3+

Configuration

To configure production environments, have your system administrator configure the ENVTYPE environment variable, setting to production, staging, dev, or local as appropriate.

In linux, add a /etc/profile.d/envtype.sh file:

#!/bin/bash
ENVTYPE=production
readonly ENVTYPE
export ENVTYPE

Configure your virtual host in Apache with:

SetEnv ENVTYPE production

Optional Configuration

To set an alternate set of production environments, use strongarm or $conf array to set the environment_makefile_product_environments variable:

$conf['environment_makefile_product_environments'] = array(
  'prod',
  'stag',
  'test',
);

Makefile location

environment_makefile assumes your makefile will be located in a makefiles directory adjacent to the Drupal webroot, and named to match the parent directory:

example.com/
├── makefiles
│     └── example.com.make
└── webroot

If you would like to specify the full path to your makefile, use strongarm or $conf to set the makefile_path variable.

To Use

environment_makefile uses an augmented drush make file to manage the enabling and disabling of modules in your Drupal deployment environments.

In your makefile, you can specify modules and submodules that should be enabled or disabled by using the following groupings:

  • enabled: these modules will be enabled in all environments
  • disabled: these modules will be disabled in all environments
  • dev_only: these modules will be disabled in production environments, and enabled everywhere else.

Example Makefile

core = 7.x

api = 2

projects[drupal][version] = "7.28"

disabled[] = overlay
disabled[] = dashboard

projects[ctools][subdir] = "contrib"
projects[ctools][version] = "1.4"
enabled[] = ctools
enabled[] = views_content
dev_only[] = bulk_export

Drush Support

Drush is the primary means of initiating environment_makefile.

drush @alias environment-makefile # alias envm

Comments

jdillick’s picture

Issue summary: View changes
PA robot’s picture

Status: Active » Needs work

Git clone command for the sandbox is missing in the issue summary, please add it.

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

jdillick’s picture

Issue summary: View changes
mradcliffe’s picture

Nice module. I'm pretty sure I could drop this into our ancient shell script drush make provisioning system when cloning sites into our development environment.

I reviewed the code and project page and filed some follow-up issues to consider regarding Documentation and only one Coder Review issue - https://www.drupal.org/project/issues/2313227

The module primarily adds a command to be used in Drush and doesn't have any security issues. Also already uses namespaces so it will be easy to maintain the module/drush command in Drupal 8!

jdillick’s picture

Issue summary: View changes
jdillick’s picture

Issue summary: View changes
PA robot’s picture

Status: Needs work » Closed (won't fix)

Closing due to lack of activity. If you are still working on this application, you should fix all known problems and then set the status to "Needs review". (See also the project application workflow).

I'm a robot and this is an automated message from Project Applications Scraper.