Book Image

Drush for Developers - Second Edition

By : Juan Pablo Novillo Requena, Juan P Novillo Requena
Book Image

Drush for Developers - Second Edition

By: Juan Pablo Novillo Requena, Juan P Novillo Requena

Overview of this book

Table of Contents (13 chapters)
Drush for Developers Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
2
Keeping Database Configuration and Code Together
Index

Meeting the update path


The update path is a list of steps that update the database of a Drupal project so that it is in sync with the code.

Running the update path in a Drupal project involves the following steps:

  1. Rebuilding Drupal's registry.

  2. Running database updates.

  3. Importing configuration.

  4. Clearing caches.

In the following sections, we will dive deeper into each of the preceding steps. These can be accomplished manually with Drupal's administration interface. However, this is a tedious process. Ideally, we would like to make the deployment process as straightforward as possible, so here is how we can automate the preceding steps with Drush commands in a Bash script that we will save as /home/juampy/scripts/update_path.sh:

#!/bin/sh
#
# Run the update path in the current project.
#
# Usage:
# Change directory into a Drupal project and run:
#   sh /path-to-this-script/update_path.sh
#
# You may need to change permissions on this script with the following:
#   chmod u+x /path-to-this-script/update_path...