Skip to content

A little bit of magic for automatically updating Drupal sites

Notifications You must be signed in to change notification settings

populist/drupal-auto-update

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pantheon Drupal Auto Update

Description

Automate Drupal core, plugin and theme updates on Pantheon with Terminus, CircleCI, Drush, BackstopJS and Slack.

This script will:

  1. Authenticate with Terminus via machine token
  2. Delete the multidev environment update-dr
  3. Recreate the multidev environment update-dr
    • Deletion and recreation is done to clear any existing changes and pull the latest database/files from the live environment
  4. Switch the multidev environment update-dr to Git mode
  5. Apply Pantheon upstream updates
    • Drupal core updates are managed in the upstream
  6. Switch the multidev environment update-dr to SFTP mode
  7. Check for and apply Drupal plugin updates via Drush, if available
  8. Check for and apply Drupal theme updates via Drush, if available
    • If no Drupal updates are available the script will complete and report the Slack
  9. Use BackstopJS to run a visual regression test between the live environment and the multidev environment
    • If discrepencies are found the script will fail and report the error to Slack
  10. Merge the multidev environment with the dev environment
  11. Deploy the dev environment to the test environment
  12. Deploy the test environment to the live environment
  13. Post a success message to Slack

License

GPLv2 or later

Setup

  1. Create a CircleCI project
  2. Add environment variables to CircleCI for the following:
  3. Add an SSH key to Pantheon and to the CircleCI project.
  4. Update the site UUID in the .env file
  5. Update scenarios in backstop.js with URLs for pages you wish to check with visual regression
    • url refers to the live URL and referenceUrl refers to the same page on the Pantheon multidev environment
  6. Ping the CircleCI API at the desired frequency, e.g. daily, to run the script

Notes

This workflow assumes the master branch (dev) and test environments on Pantheon are always in a shippable state as the script will automatically deploy changes from dev to test and live.

All incomplete work should be kept in a Pantheon multidev environment, on a separate Git branch.

Inspired by Andrew Taylor whose work on automatic updates for WordPress this project is based and Kyle Hall who brought joy and delight to Drupal utilizing Terminus 1.0.

About

A little bit of magic for automatically updating Drupal sites

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published