The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 

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

Raimundas Ra
August 12, 2021

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Answer accepted
Halyna Berezovska
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 20, 2021

@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

Raimundas Ra
September 3, 2021

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}/'
Halyna Berezovska
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 6, 2021

@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

TAGS
AUG Leaders

Atlassian Community Events