welaika / wordmove

Multi-stage command line deploy/mirroring and task runner for Wordpress
https://wptools.it/wordmove
MIT License
1.87k stars 167 forks source link

Cannot pass multiple options to rsync #95

Closed sebastianopilla closed 9 years ago

sebastianopilla commented 10 years ago

I've tried without success to pass multiple options for the rsync pull, but it seems that something (probably the photocopier gem) squashes the values into a single string, creating invalid rsync invocations.

Here's what I've tried:

rsync_options: [ "--bwlimit=256", "--human-readable", "--partial" ]
/apps/gems/gems/escape-0.0.4/lib/escape.rb:68:in `shell_single_word': no implicit conversion of Array into String (TypeError)
        from /apps/gems/gems/escape-0.0.4/lib/escape.rb:53:in `block in shell_command'
        from /apps/gems/gems/escape-0.0.4/lib/escape.rb:53:in `map'
        from /apps/gems/gems/escape-0.0.4/lib/escape.rb:53:in `shell_command'
        from /apps/gems/gems/photocopier-0.0.10/lib/photocopier/adapter.rb:34:in `run'
        from /apps/gems/gems/photocopier-0.0.10/lib/photocopier/ssh.rb:101:in `rsync'
        from /apps/gems/gems/photocopier-0.0.10/lib/photocopier/ssh.rb:37:in `get_directory'
        from /apps/gems/gems/wordmove-1.2.0/lib/wordmove/deployer/ssh.rb:46:in `block (2 levels) in <class:SSH>'
        from /apps/gems/gems/wordmove-1.2.0/lib/wordmove/deployer/base.rb:107:in `block (2 levels) in <class:Base>'
        from /apps/gems/gems/wordmove-1.2.0/lib/wordmove/cli.rb:47:in `block in pull'
        from /apps/gems/gems/wordmove-1.2.0/lib/wordmove/cli.rb:34:in `block in handle_options'
        from /apps/gems/gems/wordmove-1.2.0/lib/wordmove/cli.rb:32:in `each'
        from /apps/gems/gems/wordmove-1.2.0/lib/wordmove/cli.rb:32:in `handle_options'
        from /apps/gems/gems/wordmove-1.2.0/lib/wordmove/cli.rb:46:in `pull'
        from /apps/gems/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
        from /apps/gems/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
        from /apps/gems/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
        from /apps/gems/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
        from /apps/gems/gems/wordmove-1.2.0/bin/wordmove:6:in `<top (required)>'
        from /apps/gems/bin/wordmove:23:in `load'
        from /apps/gems/bin/wordmove:23:in `<main>'
rsync_options: "--bwlimit=256", "--human-readable", "--partial"
/usr/share/ruby/2.0.0/psych.rb:205:in `parse': (<unknown>): did not find expected key while parsing a block mapping at line 26 column 5 (Psych::SyntaxError)
        from /usr/share/ruby/2.0.0/psych.rb:205:in `parse_stream'
        from /usr/share/ruby/2.0.0/psych.rb:153:in `parse'
        from /usr/share/ruby/2.0.0/psych.rb:129:in `load'
        from /apps/gems/gems/wordmove-1.2.0/lib/wordmove/deployer/base.rb:58:in `fetch_movefile'
        from /apps/gems/gems/wordmove-1.2.0/lib/wordmove/deployer/base.rb:20:in `deployer_for'
        from /apps/gems/gems/wordmove-1.2.0/lib/wordmove/cli.rb:45:in `pull'
        from /apps/gems/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
        from /apps/gems/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
        from /apps/gems/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
        from /apps/gems/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
        from /apps/gems/gems/wordmove-1.2.0/bin/wordmove:6:in `<top (required)>'
        from /apps/gems/bin/wordmove:23:in `load'
        from /apps/gems/bin/wordmove:23:in `<main>'
rsync_options: "--human-readable --partial --bwlimit=256"
I, [2014-09-28T09:06:12.953064 #11472]  INFO -- : rsync --progress -e 'ssh -p 2233 www@remote' -rlpt --compress --omit-dir-times --delete '--bwlimit=256 --human-readable --partial' :/var/www/servers/wp/wp-content/uploads/ /var/www/wp/wp-content/uploads
rsync: --human-readable --partial --bwlimit=256: unknown option

Is this a real bug or I'm just not seeing how to write the Movefile correctly?

alessandro-fazzi commented 10 years ago

Mhhh...we have absolutely to dig a bit in this issue.

In the meanwhile thank you very much for your detailed report.

delphaber commented 9 years ago

This has ben fixed in https://github.com/welaika/photocopier/commit/f7a6549227e646786c1ed6b52423fc162ebab990 but unfortunatley we didn't release a new version of photocopier yet.

We are going to release it in the very next week

delphaber commented 9 years ago

@sebastianopilla if you are still interested in wordmove, we released a prelease version which fixes your problem. Please read #174 and test carefully