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

Delete file from remote server when removed from repository

I am just getting started with bitbucket pipelines and ftp-deploy. Is it possible to have a file which has been removed/deleted from the repository also deleted from the remote server when the pipeline is running? I cant have the entire project deleted as there are some folders and files which are saved to certain directories from other scripts.

Here is my current pipeline script.

image: atlassian/default-image:2

pipelines:
branches:
main:
- step:
name: Deploy to Production
deployment: production
script:
- pipe: atlassian/ftp-deploy:0.3.6
variables:
USER: $FTP_USERNAME
PASSWORD: $FTP_PASSWORD
SERVER: $FTP_HOST
REMOTE_PATH: /public_html/personal
DELETE_FLAG: 'false' # Don't delete existing files
EXTRA_ARGS: "--exclude=.bitbucket/ --exclude=.git/ --exclude=bitbucket-pipelines.yml --exclude=.gitignore" # Ignore these

 

1 answer

0 votes

@jamiestraks I guess, you may like rsync more, because this utility is much more flexible https://linux.die.net/man/1/rsync .

Checkout the pipe : https://bitbucket.org/atlassian/rsync-deploy/src

Regards, Galyna

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

📣 Calling Bitbucket Data Center customers to participate in research

Hi everyone, Are you Bitbucket DC customer? If so, we'd love to talk to you! Our team wants to dive deep to understand your long-term plans regarding Bitbucket DC and Atlassian Cloud. Do you plan...

233 views 2 5
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