Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

SSH Multiple Command on pipeline ssh-run

Revan Hernandy March 31, 2022

Hi Guys,

 

I have a pipeline and need to run 4 .sh files on the mode script and my pipeline as follows : 

- step:
name: Deploy to ciamsworker01
script:
- pipe: atlassian/ssh-run:0.2.2
variables:
SSH_USER: $ciamsuser
SERVER: $server
PORT: $worker01port
MODE: 'script'
COMMAND: './deploy_worker_psr.sh'
I need to run another command than deploy_worker_psr.sh, is it possible? 
PS : i tried using && and ; and the file become unread(no such file or directory)

1 answer

0 votes
Ben
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 3, 2022

Hey Revan,

Based on the ticket description, it appears you wish to run commands one after the other - if this is the case, I believe that this past community post will answer your question:
https://community.atlassian.com/t5/Bitbucket-questions/how-to-use-multiple-command-in-ssh-run/qaq-p/1112696

Hope this helps.

- Ben (Bitbucket Cloud Support)

Revan Hernandy April 5, 2022

Hi Ben,

It's not working when I put more than one shell file to execute.

The scripts become No Such files or directory please find my screenshot.SSH1.png

Ben
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 5, 2022

Hey Revan,

Are you able to ensure the path is correct? I'm noticing that there is no "./" on the other bash script listing. Can you maybe try to create a bash script in the same folder as deploy_worker_cwi.sh which echos a message and attempt to run it?

Ie ./Worker-CWI/testscript.sh && ./Worker-CWI/deploy_worker_cwi.sh

By doing so, you can test if it's an issue with the path or with the command/syntax.

Cheers!

- Ben (Bitbucket Cloud Support)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events