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:
I guess the problem is with the yaml file, but Bitbucket pipeline validator shows no errors.
I would appreciate any help at this point.
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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.