I wan to use the rsync pipe in bb pipelines. just updating existing files, ignoring .env files and some folders.
- pipe: atlassian/rsync-deploy:0.2.0
variables: USER: $USER
SERVER: $SERVER
REMOTE_PATH: $REMOTE_PATH
LOCAL_PATH: $LOCAL_PATH
SSH_PORT: $SSH_PORT
EXTRA_ARGS: -ravz --exclude={'.env','web/images/','web/cpresources/'}
DEBUG: 'true'
Hi @Alex_Jenter ,
In a new version of rsync-deploy: 0.4.0 pipe we added DELETE_FLAG variable to make --delete-after optional. To disable --delete-after flag you may write:
script: - pipe: atlassian/rsync-deploy:0.4.0 variables: USER: 'ec2-user' SERVER: '127.0.0.1' REMOTE_PATH: '/var/www/build/' LOCAL_PATH: 'build' DELETE_FLAG: 'false'
Please notice that the default value of DELETE_FLAG is true - to leave the previous logic for those who already use the pipe.
If you have any questions or suggestions - feel free to leave it, we always grateful for the feedback.
Hi @Alex_Jenter ! Currently the pipe is designed to use the --delete-after by default. To avoid deleting files you can add --max-delete=0 to extra args so no files are deleted. Please refer to the rsync man page for the more detailed description of this option. In the mean time will consider if the --delete-after should be optional.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Alexander Zhukov thanks for the reply! Yeah `--max-delete=0`, should have seen that one in the docs, was not obvoius to me. Thx anyway!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
was kinda surprised that `--max-delete=0` raised a warning at the end of the pipeline. I think it would be really awesome if there was a way to copy and preserve folders selectively without having to let the pipeline fail
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Alex_Jenter if I understand your problem correctly, you should be able to use the combination of --exclude/--include options to do what you need. For example:
EXTRA_ARGS: --exclude='*' --include='some-dir' --include='some-other-dir'
Basically, you exclude everything first and then include needed directories explicitly. Hope this is what you need.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, that is how i would achieve the functionality on the rsync side. The issue is that if one uses the `--max-delete=0` option, rsync will exit with an error code of 25, hence rendering the deployment as failed.
from the rsync man page:
If that limit is exceeded, a warning is output and rsync exits with an error code of 25 (new for 3.0.0).
Would be nice if one could achieve such behaviour without raising errors.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.