Skip to content

Latest commit

 

History

History
46 lines (39 loc) · 2.95 KB

README.md

File metadata and controls

46 lines (39 loc) · 2.95 KB

Pantheon WordPress Auto Update

Description

Automate WordPress core, plugin and theme updates on Pantheon) with Terminus, CircleCI, WP-CLI, BackstopJS and Slack.

This script will:

  1. Authenticate with Terminus via machine token
  2. Delete the multidev environment update-wp
  3. Recreate the multidev environment update-wp
    • 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-wp to Git mode
  5. Apply Pantheon upstream updates
    • WordPress core updates are managed in the upstream
  6. Switch the multidev environment update-wp to SFTP mode
  7. Check for and apply WordPress plugin updates via WP-CLI, if available
  8. Check for and apply WordPress theme updates via WP-CLI, if available
    • If no WordPress 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.