The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

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.

TAGS
AUG Leaders

Atlassian Community Events