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

pipelines:
default:
- step:
caches:
- composer
script:
- pipe: atlassian/sftp-deploy:0.3.1
variables:
USER: '<string>'
SERVER: '<string>'
REMOTE_PATH: '<string>'
LOCAL_PATH: '<string>'
# SSH_KEY: '<string>' # Optional.
# EXTRA_ARGS: '<string>' # Optional.
# DEBUG: '<boolean>' # Optional.
script:
- echo "Deploying to test environment"
- apt-get update && apt-get install -y unzip
- curl -sS https://getcomposer.org/installer | 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:

pipelines:
  default:
  - step:
      name: Deploy text file
      script:
        - echo "blah" > test-file.txt
        - pipe: atlassian/sftp-deploy:0.3.1
          variables:
             USER: ec2-user
             SERVER: 13.236.114.90
             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 https://confluence.atlassian.com/bitbucket/what-are-the-bitbucket-cloud-ip-addresses-i-should-use-to-configure-my-corporate-firewall-343343385.html

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
SERVER: 13.236.114.90
REMOTE_PATH: "/opt/sftp-test/"
LOCAL_PATH: "test-file.txt"

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

 

??

thanks.

Suggest an answer

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

What We Learned When We Researched Open Source Vulnerabilities in 7 Popular Coding Languages

...hey are a part of us, shaping how we interact with the world around us. The same holds true for programming languages when we think about how different kinds of vulnerabilities raise their heads in t...

1,051 views 0 3
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