Automattic / vip-cli

The VIP CLI
https://docs.wpvip.com/vip-cli/
MIT License
58 stars 16 forks source link

Automatically Triggering a Datasync Command After Completing Database Sync in VIP Local Development Environment #1958

Closed svyazy closed 1 month ago

svyazy commented 1 month ago

Desired Behavior

It would be very convenient to have the custom CLI command wp vip data-cleanup datasync run during the final steps of a data sync or when importing database content to a VIP Local Development Environment, similar to how it currently works when syncing data from a production environment to a non-production environment.

Actual Behavior

Now, the vip dev-env sync sql VIP-CLI command does not trigger the data-cleanup command when it finishes.

Steps to Reproduce the Problem

  1. Run vip @example-app.develop dev-env sync sql --slug=example-site
  2. Ensure that the vip data-cleanup command wasn't run, so neither vip_datasync_cleanup, nor vip_sqlimport_cleanup was triggered.

Additional notes

To implement this feature, I'd suggest simply executing the wp vip data-cleanup sql-import command once the SQL import process is completed:

await exec( lando, this.slug, [ 'wp', 'vip', 'data-cleanup', 'sql-import' ] );