Forums

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

Pipelines SSH - Using a script for COMMAND, want to pass in a variable

rob williams
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!
January 15, 2020

I'd like to use the same deploy.sh script across all branches.

But I'd have to be able to pass in a variable to accomplish this.

Is this possible?

My configuration is:

script:

- pipe: atlassian/ssh-run:0.2.3

variables: SSH_USER: $SSH_USER 

SERVER: $SERVER

COMMAND: 'deploy.sh "devsav"'

MODE: 'script' # Tells the BB pipeline to run the script specified.

PORT: '18765'

1 answer

0 votes
Alexander Zhukov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 16, 2020

Hi @rob williams , check out this answer to a similar question https://community.atlassian.com/t5/Bitbucket-Pipelines-questions/Can-I-insert-variables-from-a-bitbucket-into-a-script-when-I-use/qaq-p/1207433#M1504. You should be able to use the envsubst utility to inject environment variables into your script.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events