Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,368,441
Community Members
 
Community Events
168
Community Groups

How I can deploy only commited files via bb.yml pipeline to droplet

Edited

It's possible to deploy only files which was changed? Cause I used scp pipe and rsync, seems at remote server it's overwriting files at every deploy?

Currently for php-fpm project to upload files using this one pipe, which seems faster than scp pipe of Bitbucket

name: deploy to staging
deployment: Staging
trigger: manual
script:
- pipe: atlassian/rsync-deploy:0.4.4
variables:
USER: $USER
SERVER: $SERVER
REMOTE_PATH: '/var/www/html'
LOCAL_PATH: '${BITBUCKET_CLONE_DIR}/'

 

1 answer

1 accepted

0 votes
Answer accepted

@Raimundas Ra you may add a lot of different options, that rsync has,  through EXTRA_ARGS variable. In this case reading rsync man, you may need -t https://linux.die.net/man/1/rsync

In the section usage:

CWrsync -t *.c foo:src/

This would transfer all files matching the pattern *.c from the current directory to the directory src on the machine foo. If any of the files already exist on the remote system then the rsync remote-update protocol is used to update the file by sending only the differences. See the tech report for details.

That's why pass

EXTRA_ARGS: '-t'

or

EXTRA_ARGS:
- '--times'

Check this up with documentation and ensure you use rsync in the right way, you need

Regards, Galyna

Thank you for your help Galyna, but just would like to confirm that only this option with flag -c or --checksum working for me instead -t  or '--times'

But anyway thank you, u showed me the right way :) 

 

EXTRA_ARGS: '-c --update ${BITBUCKET_CLONE_DIR}/'

@Raimundas Ra yes, this is actually question to rsync manual, but this should work since ${BITBUCKET_CLONE_DIR} in extra args is understood as string and real value will be in the pipe:

`rsync .... -c --update my-current-cloned-dir my-path ...`

.

Also in extra args you can pass multiple options, once you need.

Regards, Galyna

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events