Skip to content

Instantly share code, notes, and snippets.

@travisbutterfield
Last active May 11, 2022 21:47
Show Gist options
  • Save travisbutterfield/e694ee864ce420c9b6e3743b01c47c21 to your computer and use it in GitHub Desktop.
Save travisbutterfield/e694ee864ce420c9b6e3743b01c47c21 to your computer and use it in GitHub Desktop.
Workflow for deploying config changes in D9

Workflow for deploying config changes in D9

/* This workflow assumes you have installed Drush and have downloaded Pantheon site aliases with terminus aliases */

  1. Set bash variable: SITE=<sitename>
  2. Clone your LIVE environment to DEV in Pantheon terminus env:clone-content --updatedb -- $SITE.live dev (Optional, but recommended)
  3. Commit all LOCAL changes in Git.
  4. Export configs on LOCAL: drush config:export
  5. Commit changes on LOCAL: git commit -am "export local configs to code"
  6. Pull remote changes from LIVE to LOCAL: drush config:pull @$SITE.live @self:../config/
  7. Resolve any conflicts and then commit on LOCAL: git commit -am "resolve config code conflicts"
  8. Push changes up to remote DEV: git push origin
  9. Import configs from pushed code into remote DEV database: terminus drush $SITE.dev -- config:import
  10. Push changes from DEV to TEST: terminus env:deploy --updatedb --sync-content -- $SITE.test && terminus env:cc $SITE.test
  11. Import configs from pushed code into remote TEST database: terminus drush $SITE.test -- config:import
  12. Push changes from TEST to LIVE terminus env:deploy --updatedb -- $SITE.live && terminus env:cc $SITE.live
  13. Import configs from pushed code into remote LIVE database: terminus drush $SITE.live -- config:import
  14. Rebuild the cache on remote LIVE site: terminus drush $SITE.live -- cr
  15. Unset bash variable unset SITE

Notes: If you did it right, you shouldn't mess anything up on the remote if you do it this way (assuming someone doesn't change anything on you. Ideally, you should put the site into Maintenance Mode before doing this, just to avoid any surprises).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment