Hi folks,
I'm trying to use the parameter --rsync-path='sudo rsync' in the EXTRA_ARGS field. But I get caught with strange escapings. I tried escaping the single quote with '' (two single quotes). I tried double quotes within the single quoted string. Nothing works. What's wrong?
e.g.
- pipe: atlassian/rsync-deploy:0.2.0
variables:
USER: 'bitbucket'
SERVER: 'fe01.mydomain.de'
REMOTE_PATH: '/var/www/public/sandbox'
LOCAL_PATH: '.'
DEBUG: 'true'
EXTRA_ARGS: '-rzhv --delete --stats --rsync-path="sudo rsync" --exclude=/sandbox/ --exclude=/sandbox2/ --exclude=/test/ --exclude=/vanilla/ --exclude=/var/ --exclude=/web/ --exclude=/files/ --exclude=/media/ --exclude=/config.php --exclude=*.dist --exclude=/.git/ --exclude=/.bitbucket/'
Ends in
+ run rsync -rp --delete-after -rzhv --delete --stats '--rsync-path="sudo' 'rsync"' --exclude=/sandbox/ --exclude=/sandbox2/ --exclude=/test/ --exclude=/vanilla/ --exclude=/var/ --exclude=/web/ --exclude=/files/ --exclude=/media/ --exclude=/config.php '--exclude=*.dist' --exclude=/.git/ --exclude=/.bitbucket/ . xxx@xxxx.de:/var/www/public/sandbox
INFO: Starting RSYNC deployment to xxx.de:/var/www/public/sandbox...
+ echo rsync -rp --delete-after -rzhv --delete --stats '--rsync-path="sudo' 'rsync"' --exclude=/sandbox/ --exclude=/sandbox2/ --exclude=/test/ --exclude=/vanilla/ --exclude=/var/ --exclude=/web/ --exclude=/files/ --exclude=/media/ --exclude=/config.php '--exclude=*.dist' --exclude=/.git/ --exclude=/.bitbucket/ . xxx@fxxx.de:/var/www/public/sandbox
+ set +e
rsync -rp --delete-after -rzhv --delete --stats --rsync-path="sudo rsync" --exclude=/sandbox/ --exclude=/sandbox2/ --exclude=/test/ --exclude=/vanilla/ --exclude=/var/ --exclude=/web/ --exclude=/files/ --exclude=/media/ --exclude=/config.php --exclude=*.dist --exclude=/.git/ --exclude=/.bitbucket/ . xxxx@xxxx.de:/var/www/public/sandbox
++ rsync -rp --delete-after -rzhv --delete --stats '--rsync-path="sudo' 'rsync"' --exclude=/sandbox/ --exclude=/sandbox2/ --exclude=/test/ --exclude=/vanilla/ --exclude=/var/ --exclude=/web/ --exclude=/files/ --exclude=/media/ --exclude=/config.php '--exclude=*.dist' --exclude=/.git/ --exclude=/.bitbucket/ . xxx@xxxx.de:/var/www/public/sandbox
+ output='Warning: Permanently added the RSA host key for IP address '\''xx.99.xxx.89'\'' to the list of known hosts.
bash: -c: line 0: unexpected EOF while looking for matching `"'\''
bash: -c: line 1: syntax error: unexpected end of file
Hi @[deleted] . The problem is that pipe treats the command as a list of separate tokens, so
'--rsync-path="sudo' 'rsync"'
becomes two separate strings. We'll try to figure out how to avoid this problem.
That would be great. I'll try the vanilla rsync command, meanwhile.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Alexander Zhukov Did you figure it out? This is not answered
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
image: atlassian/default-image:latest
pipelines:
default:
- step:
name: 'Deployment to dev'
deployment: development
script:
- rsync -rp --verbose --delete-after --rsync-path='sudo rsync' $BITBUCKET_CLONE_DIR/ ${USER}@${REMOTE_SERVER}:${REMOTE_PATH}
@Roman Szymański that's working for me.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.