Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding diff command for remote exporting #5957

Open
wants to merge 1 commit into
base: 12.x
Choose a base branch
from

Conversation

generalredneck
Copy link

@generalredneck generalredneck commented Apr 12, 2024

Now I know there are several ways of exporting configuration now, but at the moment, I find it difficult on Pantheon and Acquia to. I've been eyeing that --diff option on drush config:export for a while thinking about how nice it would be if I could grab that diff and apply it it locally to my configuration directory and not have to worry about ssh access, setting up site aliases, or having to download the database backup.

for the quick one off I've been using drush config:get and pushing the output to the appropriate file... with something like this:

DRUSH="acli drush acme.prod --";
#DRUSH="terminus drush acme.live --";
#DRUSH="drush @live"
SYNC_DIR="./config/default"
$DRUSH config:status --format=list | xargs -I{} bash -c '$2 config:get "$1" > "$3/$1.yml"' -- {} "$DRUSH" "$SYNC_DIR"
$DRUSH config:status --format=list --state='Only in sync dir' | xargs -I{} bash -c 'rm "$3/$1.yml"' -- {} "$DRUSH" "$SYNC_DIR"

However if we get the diff into a clean text format I can do the following:

terminus drush acme.live -- config:diff | patch -p3 --directory config/default/

and it's super fast and much less text transfer.

Here is my attempt at that.

For what it's worth, I'm perfectly fine with people telling me of a better way or how they do it, but I do see a performance value in this change.

@weitzman
Copy link
Member

weitzman commented Apr 13, 2024

This is the problem that config:pull seeks to solve. I know that command works on Acquia. Never tried with Pantheon.

Performance difference should be negligible. These are tiny text files we are transferring. And this is an infrequent operation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants