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 Jira

Admins, notify your Jira instance of system-wide changes with the new admin announcement banner

Hi All! We’re excited to share the launch of an announcement banner that lets Jira site administrators communicate directly to their users across Jira Cloud instance.   📢 Get y...

120 views 6 6
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