The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

BitBucket Deploy to Remote Server using SSH

Danny Younes
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 3, 2019

I am trying to write a YAML pipeline script to deploy files that have been altered from my bitbucket repository to my remote server using ssh keys. The document that I have in place at the moment was copied from bitbucket itself and has errors:

 

pipelines:
  default:
  - step:
      name: Deploy to test
      deployment: test
      script:
      - pipe: atlassian/sftp-deploy:0.3.1
      - variables:
         USER: $USER
         SERVER: $SERVER
         REMOTE_PATH: $REMOTE_PATH
         LOCAL_PATH: $LOCAL_PATH


I am getting the following error

Configuration error
There is an error in your bitbucket-pipelines.yml at [pipelines > default > 0 > step > script > 1]. To be precise: Missing or empty command string. Each item in this list should either be a single command string or a map defining a pipe invocation.

My ssh public and private keys are setup in bitbucket along with the fingerprint and host. The variables have also been setup.
How do I go about setting up my YAML deploy script to connect to my remote server via ssh and transfer the files?

 

Thanks

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
davina
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 30, 2019

Hi @Danny Younes 

There is a problem with your yaml configuration. You need to indent some things.

Here is the fixed example. I also bumped the sftp deploy pipe version:

pipelines:
  default:
    - step:
        name: Deploy to test
        deployment: test
        script:
          - pipe: atlassian/sftp-deploy:0.4.0
variables:
USER: $USER
SERVER: $SERVER
REMOTE_PATH: $REMOTE_PATH
LOCAL_PATH: $LOCAL_PATH
# SSH_KEY: '<string>' # Optional.
# EXTRA_ARGS: '<string>' # Optional.
# DEBUG: '<boolean>' # Optional.
TAGS
AUG Leaders

Atlassian Community Events