ChromaticHQ / usher

Custom Robo commands for use on PHP projects.
https://packagist.org/packages/chromatic/usher
11 stars 6 forks source link

Add support for custom database dump to `dev:refresh` command #172

Closed agarzola closed 10 months ago

agarzola commented 10 months ago

Description

Developers sometimes need to work off of a non-production database dump. One such case is when a long-running migration branch is in active development and there are other development efforts that branch off of that branch. Devs branching off of the migration branch often find themselves needing to import a database dump from a “staging” or “dev” environment that has been set up to track the migration branch.

Currently, developers who want to use dev:refresh might do something like:

  1. Run composer robo dev:refresh ddev. This imports the prod database.
  2. Run ddev import-db --file=./some-non-prod-db-dump.sql.gz.

That certainly gets the job done, but on projects with database dump sizes in the gigabytes, it takes a very long time to actually refresh one’s dev environment. It would be really useful to be able to pass an option to the dev:refresh command which, when present, makes Robo skip the prod database download altogether and use the provided dump instead.

Issue Owner

Acceptance Criteria

Alternatives Considered

n/a

Additional Context

Requested in our #devops channel.

agarzola commented 10 months ago

@markdorison Assigned this to you for visibility.