Create
cancel
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

Pipeline configuration error - Missing or empty command string

Hello,

I'm trying to SSH to my server and execute some commands each time I push code to master branch. I'm using ssh-run pipe. I've defined all variables used in this script. I also added ssh key, added host to the list of known hosts and fetched fingerprint.

This is my bitbucket-pipelines.yml file:

image: atlassian/default-image:2

pipelines:
  branches:
    master:
      - step:
          script:
            - name: "SSH Deploy to production web"
            - pipe: atlassian/ssh-run:0.2.6
              variables:
                SSH_USER: $SSH_USER
                SERVER: $SSH_SERVER
                COMMAND: $SSH_COMMAND
                PORT: $SSH_PORT

Now the error I get is:

Screenshot from 2020-08-05 17-21-45.png

I guess the problem is with the yaml file, but Bitbucket pipeline validator shows no errors.

I would appreciate any help at this point.

1 answer

1 accepted

1 vote
Answer accepted

I think you want the "name" property under "step" rather than "script":

image: atlassian/default-image:2

pipelines:
branches:
master:
- step:
name: "SSH Deploy to production web"
script:
- pipe: atlassian/ssh-run:0.2.6
variables:
SSH_USER: $SSH_USER
SERVER: $SSH_SERVER
COMMAND: $SSH_COMMAND
PORT: $SSH_PORT 

 Caveat: have not tested this myself.

Hi @mdgmichael ,

I actually solved it by removing name property altogether.

Now my bitbucket-pipelines.yml file looks like this:

image: atlassian/default-image:2

pipelines:
  branches:
    master:
      - step:
          script:
            - pipe: atlassian/ssh-run:0.2.6
              variables:
                SSH_USER: $SSH_USER
                SERVER: $SSH_SERVER
                COMMAND: $SSH_COMMAND
                PORT: $SSH_PORT

 Cheers!

Like mdgmichael likes this

Suggest an answer

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

New improvements to user management in Bitbucket Cloud 👥

Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...

3,736 views 10 16
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