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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


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
Community Members
Community Events
Community Groups

Simple SFTP Deployment

Trying to execute a simple FTP deploy from bitbucket repo to FTP host

Pipelines YML at "" keeps displaying error on lines by columns such as; "Expected a section but found sequence" or "Unexpected property 'deployment'" or "Unexpected property 'script'"

Kept on trying to execute code samples for FTP or SFTP deployments no luck using image provided by BITBUCKET

Even searched for thsi Post which seems to be outdated but always appears on search results:

1 answer

1 vote
Patrik S Atlassian Team Jun 14, 2022

Hello @Edison Chango ,

Thank you for reaching out to Atlassian Community! 

The errors you reported are usually because of formatting issues in your YML file. You can use the below link to validate the YMLconfiguration for any error in the formatting before actually committing the bitbucket-pipelines.yml file in your repository : 

As for the SFTP deploy, I would suggest using the atlassian/sftp-deploy pipe, as it has most of the underlying code already done for you, and you just need to provide some variables. Please find below an example of using that pipe :

- step:
name: 'Deploy with SFTP'
- echo "This step will use atlassian/sftp-deploy pipe"
pipe: atlassian/sftp-deploy:0.5.11
     USER: '<string>'
     SERVER: '<string>'
     REMOTE_PATH: '<string>'
     LOCAL_PATH: '<string>' #Optional

For more details about the atlassian/sftp-deploy pipe and how to configure the variables, please refer to the following documentation : 

Hope that helps! Let me know in case you have any questions or run into any issues.

Thank you @Edison Chango .

Kind regards,

Patrik S

This seems to be working.  Just one more detail.  Not sure f this is about the YM, but after all deployments were performed, there seems to be a lack of privileges or command to be run for getting files deleted.  Even simple txt files, after they are deleted from Source tree, removed from bitbucket, they do not get deleted from server.


This YML should be showcased, how can i promote this code, it comes very handy and should be accessible to anybody deploying small stuff?  Just need to get the successful deletion issue.


Any advise will be greatly appreciated.


Patrik S Atlassian Team Jun 20, 2022

Hello @Edison Chango ,

If I understand you correctly, you would like the files deleted from the source to also be deleted from the destination (your FTP server).

If that is the case, I'm afraid that SFTP does not support it, as it only allows you to transfer the files from one side to another, and not actually synch the folders.

In order to actually synch the files, and delete from the destination folder all the extraneous files that are not in the source folder, I would suggest using the atlassian/rsync-deploy pipe with the DELETE_FLAG : 

- pipe: atlassian/rsync-deploy:0.7.1
    USER: '<string>'
    SERVER: '<string>'
    REMOTE_PATH: '<string>'
    LOCAL_PATH: '<string>'

This will delete all the files from the destination folder that are not in the source folder.

More details about the available variables for that pipe can be found in its official documentation : 


Thank you, @Edison Chango !

Kind regards,

Patrik S

Suggest an answer

Log in or Sign up to answer

Atlassian Community Events