Remotely push active config into version control
This command wraps the sub-commands for a typical on-server config sync -- switching to SFTP, dumping, commiting, and switching back to git -- in a single command. The best part is that each subcommand waits for the previous command to finish, to avoid convergence problems.
terminus cex site.env [--message="Optional commit message"]
Export active config from a remote environment to local
For a CI site, we can't do on-server commits - we need to send them to a completely different repository. Drush offers a way to export active config within the same site, or to sync staged config between two sites. The missing piece is exporting active config from one environment to another, especially a local working directory which may not be bootstrappable. This command makes that bridge, and addresses the common use case of more easily fetching "Config from prod".
NB: be sure to use the --destination
flag if you're not in a working drupal environment
terminus cexr site.env [--destination="Optional local destination"]
Depending on which version of Terminus you have installed, install the plugin by using one of the following commands. You can see which version of Terminus you're using by executing terminus --version
.
composer create-project --no-dev -d ~/.terminus/plugins aaronbauman/terminus-config-export
terminus self:plugin:install aaronbauman/terminus-config-export
Together with Drush, the Terminus plugin will:
- Check for difference between active and staged config (
drush cst
). - If there's a difference, put the target environment into SFTP mode.
- Run
drush cex
remotely to export config. - Commit the config changes to VCS.
- Put the site back into git mode.
- Create a private directory in the remote environment (given by
--remote-destination
option) - Run
drush cex
remotely to export config to the given directory. rsync
the config to the local environment, as determined by--destination
option