Skip to content
xforty edited this page May 8, 2012 · 1 revision

There are two ways to execute drush-deploy from the command line.

  1. The primary way is to run the drush-deploy command which is provided by the package. Using this you can easily deploy any Drupal project:

     drush-deploy TARGET=staging 
    

    This will by default run the deploy task however you can override this by supplying an explicit list of tasks to run:

     drush-deploy deploy:setup targets TARGET=staging
    

    The drush-deploy command does not require any files in the Drupal project to run.

  2. Because it is a capistrano plugin it also can be used like any capistrano plugin in a capistrano project. If your Drupal project has a capfile with

     require 'drush_deploy'
    

    in it you can run the cap program supplied by capistrano. cap does not have a default task so to deploy you must specify it explicitly.

     cap deploy TARGET=staging
    

Deployment

When doing a deploy, drush-deploy will perform the following actions by default.

  • Create a new unique directory releases/<current timestamp> in the destination directory and upload the site files to it.
  • Symlink shared/default/files to releases/<current timestamp>/sites/default/files
  • Generate shared/default/settings.php from the default.settings.php file along with database settings. See Database-Configuration
  • Backup the current Drupal database as <db_name>_<previous release timestamp>
  • Run any update scripts of updated Drupal modules (See update-modules on Variables)).
  • Symlink releases/<current timestamp> to current, making it the live version of the site
Clone this wiki locally