Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status

RSS

activelamp_drupal (4) Versions 0.0.3

Cookbook for deploying Drupal websites and for installing Drush

Policyfile
Berkshelf
Knife
cookbook 'activelamp_drupal', '= 0.0.3', :supermarket
cookbook 'activelamp_drupal', '= 0.0.3'
knife supermarket install activelamp_drupal
knife supermarket download activelamp_drupal
README
Dependencies
Quality 0%

Build Status

Description

This cookbook provides an easy way to deploy a Drupal website, as well as a recipe for installing Drush.

Requirements

  • php
  • composer
  • git, svn, or whatever SCM system you need for your deploy.

This cookbook is not responsible for satisfying these requirements. You will have to provision your machine with these through your platform's dependency manager (apt, yum, etc), or through other cookbooks.

Platforms:

  • Tested on Ubuntu/Debian only, but the deploy actions should work with any platform.

Recipes

activelamp_drupal::drush

Installs Drush on your node:

include_recipe 'activelamp_drupal::drush'

Attributes

Option Default Description
[:activelamp_drupal][:drush][:version] "7.x" The version of Drush to install.
[:activelamp_drupal][:drush][:user] "root" The user responsible for the commands. The drush command will be registered under this user.
[:activelamp_drupal][:drush][:group] "root" The group responsible for the commands.
[:activelamp_drupal][:drush][:install_path] "/usr/local/bin/drush" Where the drush executable will be linked to.
[:activelamp_drupal][:drush][:composer_command] "composer" The Composer command that will work in your node. The default value will assume that composer is available globally. However you can specify something like "php /path/to/composer.phar" if the executable is somewhere that cannot be resolved by the $PATH environment variable.

Resources / Providers

drush_make

This resource uses the drush make command to build a Drupal site from a make file found in your project repository.

These are the things that happen during the make process:

  • drush make is called
  • Custom modules will be symlinked to the Drupal modules directory.
  • Custom themes will be symlinked to the Drupal themes directory.

Actions

  • All actions of the deploy resource is valid and works the same way, as the drush_make resource simply extends Chef::Resource::Deploy

Examples

Deploy a Drupal site
drupal_make "/path/to/project" do
    repo 'git@github.com:your_organization/your_drupal_project.git'
    git_ssh_wrapper '/tmp/ssh-wrapper.sh'
    revision 'v2.0'
    user node[:activelamp_drupal][:drush][:user]
    group node[:activelamp_drupal][:drush][:group]
    themes_dir 'themes'
    modules_dir 'modules'
    action :deploy
end

Options

All options for the deploy resource is applicable. The following options are drush_make-specific:

Option Default Description
make_file "drupal.make" The path to the make file relative to your project repository root.
build_to "_build" Where the Drupal site to be built, relative to your project repository root.
themes_dir nil Where your custom themes are relative to your project repository root. Nothing is done when nil.
modules_dir nil Where your custom themes are relative to your project repository root. Nothing is done when nil.

Configuring where themes and modules are symlinked to

By default, modules are symlinked into sites/all/modules/custom, and themes into sites/all/themes/custom. If you wish to put them somewhere else, just specify a second argument to modules_dir and/or themes_dir:

drupal_make "/path/to/project" do
    repo 'git@github.com:your_organization/your_drupal_project.git'
    git_ssh_wrapper '/tmp/ssh-wrapper.sh'
    revision 'v2.0'
    user node[:activelamp_drupal][:drush][:user]
    group node[:activelamp_drupal][:drush][:group]
    action :deploy
    themes_dir 'themes', 'themes/custom'
    modules_dir 'modules', 'modules/custom'
end

License and Authors

Author: Bez Hermoso bez@activelamp.com

Author: ActiveLAMP

Copyright: 2012-2014, ActiveLAMP

Apache 2.0 License

Foodcritic Metric
            

0.0.3 failed this metric

FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/310d307ae6f6b9506506c02e/activelamp_drupal/attributes/default.rb:1
FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/310d307ae6f6b9506506c02e/activelamp_drupal/recipes/drush.rb:7
FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/310d307ae6f6b9506506c02e/activelamp_drupal/recipes/drush.rb:10
FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/310d307ae6f6b9506506c02e/activelamp_drupal/recipes/drush.rb:14
FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/310d307ae6f6b9506506c02e/activelamp_drupal/recipes/drush.rb:15
FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/310d307ae6f6b9506506c02e/activelamp_drupal/recipes/drush.rb:16
FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/310d307ae6f6b9506506c02e/activelamp_drupal/recipes/drush.rb:22
FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/310d307ae6f6b9506506c02e/activelamp_drupal/recipes/drush.rb:24