Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Unknown filter rule: `':-' in the atlassian/rsync-deploy:0.4.4

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?

2 answers

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}/

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

⭐ Calling all Bitbucket and DevOps experts: Special showcase opportunity ⭐

Hi, Bitbucket community! Are you a DevOps practitioner (or know one in your network)? Do you have DevOps tips, tricks, or learnings you'd like to share with the community? If so, we'd love to hea...

1,514 views 4 8
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you