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

Passing arguments with ssh-run with mode script

mihailo November 22, 2019

We are using the following pipe

- pipe: atlassian/ssh-run:0.2.2
variables:
SSH_USER: $DEPLOYMENT_USER
SERVER: $DEPLOYMENT_SERVER
MODE: script
COMMAND: "scripts/deploy.sh $BITBUCKET_COMMIT $BITBUCKET_BUILD_NUMBER"

 but we are not able to pass parameters to deploy.sh script that will be run on remote server. Such error will be shown:  no such file or directory: deploy.sh foo bar

Could you support parameters for remote scripts?

2 answers

0 votes
gmarcial April 1, 2020

Yes, use the envsubst to replace the variables in your script(in your script with $VARIABLE) per local variables of the pipeline(out a new script with the variables replaced, $VARIABLE => Value).

 

Official example: 

samplereplace.png

0 votes
Fabio Scavone March 23, 2020

Is there an answer to this? I'm facing the same issue.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events