Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Once you get the Drupal site set up you'll need to push that all into git also.

Before the first deploy

Set up the staging/production server directories

Code Block

bash> cap staging deploy:setup

This will create the directories on the staging server, move the site into place, make a copy of default.settings.php if necessary, set up symbolic links inside the files directory, and set file permissions. When it's done all the Drupal files are there and Drupal is ready to install.

Install Drupal

Go to the site with your browser and run install.php.

Final preparations

Code Block

bash> cap staging drupal:post_install_configuration

This confirms that you have done the Drupal install, then sets up Drupal's public, private, and temp files paths, and does a final update.php.

A typical deploy

You are expected to have everything on your development site committed to git and your local git repo pushed to the central one before this happens.

Code Block

bash> cap staging deploy

This will 

  • push a tag for this release to git
  • do a backup of the staging db (with the staging site offline)
  • update the staging server's clone of your git repo
  • check out all the stuff from the local git repo to a revision directory on staging
  • change the 'current' symbolic link to point to the public directory inside new revision directory
  • update symbolic links from the revision directory's public/sites/default/files
  • put the site offline
  • update the site's public, private, and temp files paths
  • run update.php
  • revert any features
  • put the site back online

Server Directory

Note: We currently don't have the servers set up to follow Capistrano's 'current' symlink. To work things out I've added a 'cap' directory:
/libweb/sites/<domain name>/cap
and deployed the sites there. If you add a symlink like this
/libweb/sites/<domain name>/htdocs/capcurrent -> ../cap/current/public
you can see the deployed site at
http://<domain name>/capcurrent
BUT it only works if you turn off Clean URLS
http://<domain name>/capcurrent/?q=admin/config/search/clean-urls

Here is a JIRA issue about setting up new development and deploy servers.