I have the following code:
script:
- pipe: atlassian/rsync-deploy:0.4.4
variables:
USER: $USER_PROD
SERVER: $SERVER_PROD
REMOTE_PATH: '~/projects/${BITBUCKET_REPO_SLUG}/'
LOCAL_PATH: '${BITBUCKET_CLONE_DIR}/'
EXTRA_ARGS: --verbose --human-readable --recursive --delete-after --archive --no-perms --no-owner --no-group --include='**.gitignore' --include='/.git' --exclude='**.git' --exclude='**.bitbucket' --filter=':- .gitignore'
And got the following error:
rsync -rp --delete-after --verbose --human-readable --recursive --delete-after --archive --no-perms --no-owner --no-group --include='**.gitignore' --include='/.git' --exclude='**.git' --exclude='**.bitbucket' --filter=':- .gitignore' /opt/atlassian/pipelines/agent/build/ innovion@$SERVER_PROD:~/projects/project_name/
Unknown filter rule: `':-'
rsync error: syntax or usage error (code 1) at exclude.c(927) [client=3.1.3]
These rsync options 100% work properly, I tested them a lot of times before. This error appears only in bitbucket pipelines.
The most interesting: where did the backtick mark in the error text (`) come from?
How to fix this?
I have the same problem. Trying to do:
EXTRA_ARGS: --exclude=.bitbucket --filter=':- .gitignore'
the rsync-deploy fails with this error:
Unknown filter rule ':-'
Seeing the whole resulting rsync string it seems that --filter is wrapped with a mess of additional single quotes that divides filter rule in more parts...
I think this is a bug of atlassian/rsync-deploy:0.4.4
I found some workaround. I just wrote the rsync command myself, without the "atlassian/rsync-deploy" pipe image:
- step:
script:
- apt-get install -y rsync
- rsync --verbose --human-readable --recursive --delete-after --archive --no-perms --no-owner --no-group '--include=**.gitignore' '--include=/.git' '--exclude=**.git' '--exclude=**.bitbucket' '--filter=:- .gitignore' ${BITBUCKET_CLONE_DIR}/ ${USER_PROD}@${SERVER_PROD}:~/projects/${BITBUCKET_REPO_SLUG}/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.