Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

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

f777 February 22, 2021

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

0 votes
MXTcomunica April 13, 2021

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 

0 votes
f777 February 22, 2021

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
AUG Leaders

Atlassian Community Events