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

how to define rsync options in drush.yml #3491

Open
Schnitzel opened this issue Apr 1, 2018 · 6 comments

Comments

@Schnitzel
Copy link
Contributor

commented Apr 1, 2018

I'm trying to add some rsync options in the drush.yml

I tried with

command:
  core:
    rsync:
      options:
        chmod: 'ugo=rwX'

but it's not working. While directly via

drush -d rsync @self:%files @lagoon.migration:%files -- --chmod=ugo=rwX

it works.

I assume the problem is because it needs -- before the options.

Any idea how that works?

@greg-1-anderson

This comment has been minimized.

Copy link
Member

commented Apr 2, 2018

Yeah, -- converts everything after it from being interpreted as arguments rather than options. The Drush rsync command passes all of its extra arguments on to the shell rsync command that it exec's.

The consolidation/config feature to define additional command options in configuration does not work for additional arguments. The reason for this is that if an argument was defined in configuration, there would be no clear way to override or remove it.

Perhaps this behavior could be extended to include settings for additional options: things that appear after a -- in the command line that themselves also start with - or --. Ideas about exactly how this should work would be welcome. (n.b. this setting should be taken from somewhere other than command.x.y.options.)

Strictly speaking, this would be a feature request for https://github.com/consolidation/config

@weitzman

This comment has been minimized.

Copy link
Member

commented Apr 2, 2018

What about:

command:
  core:
    rsync:
      suffix:
        chmod: 'ugo=rwX'
@weitzman

This comment has been minimized.

Copy link
Member

commented Apr 4, 2018

So, adding support for a 'suffix' key. ping @greg-1-anderson.

@greg-1-anderson

This comment has been minimized.

Copy link
Member

commented Apr 4, 2018

Still not sure that we have 100% identified how this should behave. For example, what if the current drush.yml was configured as above, and the command line was:

drush -rsync @self:%files @lagoon.migration:%files -- --chmod=ugo=r

Would that result in rsync --chmod=ugo=r or rsync --chmod=ugo=rxW --chmod=ugo=r?

What if the configuration was exclude: foo and the commandline had --exclude=bar? If the flags are both included, how would you get rid of --exclude=--foo if you didn't want it?

@Schnitzel

This comment has been minimized.

Copy link
Contributor Author

commented Apr 4, 2018

I understand your concerns @greg-1-anderson, but I feel it's a bit over-engineered. Not many people use fancy rsync commands (I think)

in the upper example I would expect

rsync --chmod=ugo=rxW --chmod=ugo=r

if it's well documented I think people will be happy

@Krilo89

This comment has been minimized.

Copy link

commented Nov 12, 2018

@Schnitzel, I'm with @greg-1-anderson on this. It is common that projects have drush .yml files inside it, so you can do a release to an Acceptation or Test environment with a release tool like Jenkins. All drush commands are executed but the rsync command doesn't include the --delete option right now.

Is anyone getting further with this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.