c10b10 / wp-cli-deploy

A WP-Cli command that allows you to deploy the local database or uploads directory to a remote server using ssh.
173 stars 25 forks source link

Add generic push and pull file locations support #10

Open c10b10 opened 10 years ago

c10b10 commented 10 years ago

Add a way of defining custom local and remote paths pairs that work with the push / pull subcommands.

Every push & pull would check for the existence of a local / remote paths pair before execution and would trigger an error if they don't exist.

This has the added benefit of flexibility since it would allow users to define an arbitrary number of locations to push to / pull from. On the other hand, it would have the disadvantage that users should add uploads / themes / plugins local paths constants in their configuration.

Example

<?php
define( 'DEV_%%LOCATION%%_LOCAL_PATH', '/local/path/to/location' );
define( 'DEV_%%LOCATION%%_REMOTE_PATH', '/remote/path/to/location' );
$ wp deploy push dev --what=%%location%% 

Should rsync the /local/path/to/location/ to /remote/path/to/location.