Closed hawkeyetwolf closed 1 year ago
Thank you @rfay!! And apologies for not following the contribution guidelines... I was trying out this newfangled GitHub Codespaces thing, and it auto-created the PR for me. Will update the PR description later.
All good, thanks!
I decided to take out the dependency on Drainpipe, so I need to do some more testing locally to make sure all the steps still work. Marking PR as WIP draft.
Did you get this to where you wanted it? If so, please mark ready for review.
No response from OP. Happy to reopen when you're ready to mark it ready for review.
The Problem:
Cleaning up/initializing your Drupal environment to begin new work, or switching branches to test someone else's work, requires several steps. It's easy to forget some of them, and it takes cognitive load to remember. Lots of folks write a little custom bash alias/script to handle it for them on a given project. This is just a very complete version of that, and can be used on most Drupal projects.
The steps required to refresh a Drupal environment include:
How this PR Solves The Problem:
Provides a single command to completely (re)initialize/refresh your ddev Drupal environment. Supports various flags to turn steps on and off. See README.md for the full list of options. This command is especially useful when collaborating with other developers or otherwise switching between branches for testing.
Manual Testing Instructions:
Create a ddev Drupal environment. You can follow the Drupal.org documentation, or use an existing site you have.
Copy the
refresh
script into place:.ddev/commands/host/refresh
Also install the
drupal-login
andgulp
custom commands from ddev-contrib.Run
ddev refresh
, and see that all the default steps run.Run
ddev refresh some-existing-branch
and see that an existing branch is checked out + pulled before refreshing.Run
ddev refresh -h
and see all the options available. Try out some them. E.g.,--no-restart
to skip restarting ddev, and--no-login
to skip the login step at the end.The only two steps you can't (easily) test are
--import-db
and--existing-sql
to download and import a database dump from some upstream environment, as those are usually project specific and require some extra setup to use. Since they don't run by default, I chose to leave them in place for users to leverage if they wish.Manual Testing Environments: