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

Expected either a string or a pipe

Trying to set up SFTP deploy but copying the sample code into my yml file causes an error no matter how I seem to do the indentation. First time doing anything like this so any help appreciated.

# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: php:7.1.1

- step:
- composer
- pipe: atlassian/sftp-deploy:0.3.1
USER: '<string>'
SERVER: '<string>'
REMOTE_PATH: '<string>'
LOCAL_PATH: '<string>'
# SSH_KEY: '<string>' # Optional.
# EXTRA_ARGS: '<string>' # Optional.
# DEBUG: '<boolean>' # Optional.
- echo "Deploying to test environment"
- apt-get update && apt-get install -y unzip
- curl -sS | php -- --install-dir=/usr/local/bin --filename=composer
- composer install
- vendor/bin/phpunit

1 answer

1 accepted

0 votes
Answer accepted

Hey @jhorning-tyler ,

You need to fill in the pipe parameters (i.e. replacing <string> with the values you want to use). 

For example:

  - step:
      name: Deploy text file
        - echo "blah" > test-file.txt
        - pipe: atlassian/sftp-deploy:0.3.1
             USER: ec2-user
             REMOTE_PATH: "/opt/sftp-test/"
             LOCAL_PATH: "test-file.txt"

Hi Raul,

Thanks for the reply! I should have mentioned I left those in my post just to keep my server info private. This morning, I moved the -pipe section to the bottom and that fixed that error. Now, I have one more question: What is the IP address of the Bitbucket machine that will be hitting our server? Our server/network guy has locked down our SFTP so that it only works if you are on our server and I think that is the reason the pipeline is failing at composer install. Let me know if I need to create a new post since that is an unrelated issue.

Graham Gatus Atlassian Team Mar 07, 2019

@jhorning-tyler you should whitelist all IP ranges listed under 'Valid IP addresses for Bitbucket Pipelines build environments' at

If you are using ssh or scp and will be performing host verification via the Pipelines UI, you will also need to whitelist IPs listed under 'Valid IP addresses for Bitbucket Pipelines services' (ssh key scans for host key verification are performed from Bitbucket Pipelines services).

Ok, great! I will pass this info on. Thank you so much for your help!

Can i duplicate LOCALPATH and REMOTE PATH?


USER: ec2-user
REMOTE_PATH: "/opt/sftp-test/"
LOCAL_PATH: "test-file.txt"

REMOTE_PATH: "/opt/sftp-test2/"
LOCAL_PATH: "test-file.txt"




@daniellucena2   if you need to copy to two locations, you need to use two pipes. You can also run such scripts in parallel steps. Check out the doc

Regards, Galyna

Suggest an answer

Log in or Sign up to answer
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...

229 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