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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Inline script variables subtitling.

Hello,

Is it possible to prevent variables subscription in Bamboo inline powershell / bash without moving it to the external script's file (For insline script all ${bamboo.<var>} become real data.)?

Bamboo version is 5.15.

 

2 answers

Hi neb0t,

 Based on the description it appears you're trying to prevent Bamboo from dumping its own variables to the Terminal. If that is not correct please let me know and we'll go from there. In the meantime take a look at the Community post Can you wait and set Bamboo Variables in an inline script as that may provide some additional clues to help you accomplish this goal.

 Also, if you could provide a bit more of a description of what you're trying to accomplish and possibly provide a use case that would allow us to more accurately answer this question.

Cheers,

Branden

Yes. I do not want to expose my password in the task or terminal or any other section in the job configuration.

Inline script variables also looks badly - I still can see unmasked password.

From official atlassian documentation I found that I'm not able to prevent dumping date from inline script but I couldn't find any information about external (file) script.

i just want to use ${bamboo.SUPER_PASSWORD} in the inline script, but I'm getting value instead of original definition.

Hi,

When running a Script task in Bamboo, all bamboo<dot> variables will become available to the script to be used whenever needed, e.g. If in the script inline you are attempting to connect to another server, e.g:

ssh user01:${bamboo.password}@domain.com

In the Bamboo logs, the password will be masked, however, ${bamboo.password} value will be used when the SSH command gets executed.  When running a Script task, Bamboo creates a child session of Terminal/CMD/Powershell and the Bamboo variables will be available for the duration of the script.


If user has defined a variable (e.g bamboo.password = mySecretPassword) in Bamboo and in that particular JOB he wants to run a Script task but not use the value defined for that variable, you could run a custom build overwriting the existent variables.

At this point can I have the following informaiton:

  • What you have defined in bamboo
  • Your inline script
  • The actual result
  • The expected result

Cheers,

Branden

Sure. 

So, here is what I got:

link

Original script was :

link

 

I used this plugin: link

0 votes
Jeyanthan I Atlassian Team Aug 23, 2017

Hi,

Did you mean that you wanted to Inject new Bamboo variables from your script file directly instead of Inject Bamboo variables task that wants a properties file location?

If your requirement is to just use variables within a script, how about using just the environment variables of your operating system?

Not exactly: I want to grub value from the Bamboo shared variables during runtime (job execution).

i used DSL plugin to generate script inline job, but bamboo replaced all ${bamboo.var} with the values.

Then I tried to use $bamboo_var but output did not have any valid data from the shared variable.

I think if I will use external file (powershell script) with bamboo variable then it might work.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bamboo

Bamboo 7.1 is here and is packed with value!

I'm happy to announce that Bamboo 7.1 has been released and it’s overflowing with awesome new features. Top-voted issues First and foremost, a bunch of JAC top voted issues has been delivered - y...

696 views 1 6
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you