DevShop Provision

Homepage: http://drupal.org/project/devshop

DevShop Provision

Drupal development infrastructure made easy.

This module provides the backend commands needed to deploy and manage sites using the DevShop git and features based development workflow.

About DevShop

The goals of DevShop are...

  1. to simplify management of multiple environments for multiple Drupal projects.
  2. to provide web-based tools that streamline the Drupal site building workflow.
  3. to provide a common, open-source infrastructure for Drupal development shops.

Installation

To install devshop_provision, simply use drush:

$ drush dl devshop_provision

Or, you can download the source code to any available drush commands folder, such as /usr/share/drush or ~/.drush

Usage

DevShop Provision works by providing a new Provision class called "Project".

To start, you must have a Project drush alias. Using the DevShop+Hostmaster system will make this much easier, but if you wish to only use the backend, you can create a project alias with provision-save, for project NAME:

  $ drush provision-save project_NAME --context_type=project --code_path=/var/aegir/projects/NAME --git_url=http://git.url/to/repo.git --base_url=NAME.server.com

    $ drush provision-save project_NAME --project_name=NAME --context_type=project --code_path=/var/aegir/projects/NAME --git_url=git@github.com:devudo/drupal-flat.git --base_url=NAME.server.com

Commands

DevShop contains a set of features that make Drupal site building within a version-controlled code workflow quick and easy.

Currently you must create new platforms within a project in hostmaster. Once created, you can execute the following commands:

1. Pull Code

  $ drush @project_NAME provision-devshop-pull ENVIRONMENT

This task runs on the dev platform for this project. It runs git pull, and optionally runs new updates, reverts features, and clears caches. It is used to keep the dev server up to date on every commit via the devshop_pull module, and can be used as the deployment task.

  • Git Pull the code for your site's platform.
  • Then, all optionally:
    • Run update.php.
    • Revert all Features modules
    • Clear caches

2. Commit Features

  $ drush @project_NAME provision-devshop-commit ENVIRONMENT --message="My Commit"

This task integrates with Features.module to make it very easy to commit your changes to your features.

  • Calls drush features-update-all
  • Commits the result, with a part automated and part customized commit message.
  • (Optionally) pushes the commits.
  • (Optionally) force-reverts after a commit.

3. Sync Content

  $ drush @project_NAME provision-devshop-sync SOURCE_ENVIRONMENT DESTINATION_ENVIRONMENT

This task makes it easy to syncronize the database and files down from other environments within the project.

WARNING: This will DESTROY the destination site's database!

This task:

  • (optionally) Pulls code
  • Drops the @destination database.
  • Creates an SQL dump from @source.
  • Copies the SQL dump to the local system (if @source is a remote).
  • Imports the SQL dump into @destination database.
  • (optionally) Runs update.php.
  • (optionally) Runs features-revert-all.
  • (optionally) Clears all caches.

Commands

$ drush --filter=devshop_provision

All commands in devshop_provision: (devshop_provision)
provision-devshop-co  Export the site's Features and commit the result.                                             
mmit (pdc)                                                                                                          
provision-devshop-pu  Pull & verify platform code and (optionally) run update.php, clear cache, and revert features.
ll (pdp)                                                                                                            
provision-devshop-sy  Sync database (and files, coming soon) from a chosen source site.                             
nc (pds)                                                                                                            
provision-devshop-te  Run a group of SimpleTest tests.                                                              
st (pdt)                                                                                                            

$ drush provision-devshop-commit --help

Export the site's Features and commit the result.

Examples:
drush @project_mysite              Recreates and Commits all features from the dev environment of @project_mysite with an additional commit
provision-devshop-commit dev       message.                                                                                                
--message="changed some settings"                                                                                                          


Arguments:
environment                               The name of the environment to commit from.


Options:
--message                                 Add a commit message                                     
--revert                                  Force revert all features after exporting and committing.


Aliases: pdc

$ drush provision-devshop-pull --help

Pull & verify platform code and (optionally) run update.php, clear cache, and revert features.

Examples:
drush @project_mysite                    Triggers a git pull and a clear cache command on @project_mysite's dev and test environments.
provision-devshop-pull dev test --cache                                                                                               


Arguments:
environments                              A list of environment names to Pull Code to.


Options:
--update                                  Run update.php after code pull.     
--revert                                  Revert all features after code pull.
--cache                                   Clear all caches after code pull.   


Aliases: pdp

$ drush provision-devshop-sync --help

Sync database (and files, coming soon) from a chosen source site.

Examples:
drush @project_mysite            Syncs the database from for project_mysite's live to  project_mysite's dev server.
provision-devshop-sync live dev                                                                                    


Arguments:
from                                      Environment to sync from.
to                                        Environment to sync to.  


Options:
--update                                  Run update.php after content sync.     
--revert                                  Revert all features after content sync.
--cache                                   Clear all caches after content sync.   
--files                                   Sync site files.                       


Aliases: pds

$ drush provision-devshop-test --help

Run a group of SimpleTest tests.

Arguments:
environment                               The name of the environment to run tests on.


Options:
--tests-to-run                            The list of tests to run.                    
--sync-from-live                          Sync contents from Live before running tests.


Aliases: pdt