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

Delete file from remote server when removed from repository

jamiestraks August 10, 2021

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

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

Atlassian Community Events