Run as different user on remote bamboo agent?

Currently we launch the remote agent Bamboo process using a special "bamboo" user account. However, some people would like the ability to run builds as another user. Is it possible to set what account to use for a Bamboo build? If there isn't an out-of-box setting, has anyone ran into this and found a work around?

1 answer

1 accepted

0 vote

A simple workaround would be to launch your build manually from a script task. However, all Bamboo goodness (like parsing output for errors) will be unavailable then.

What I would suggest is to wrap your builder with a script and make Bamboo think it's a regular builder. The wrapper script should parse the builder arguments and detect which user should be used for building, filter out that user argument and run the builder using su or runas.

That covers the build. If you want to check out, it's trickier. You should be able to use a wrapper script technique with Git, Mercurial or Perforce, but you won't be able to pass the user argument to them and would have hardwire the correct user basing on the plan key (you can get that from the checkout directory name). Note that although for checkout the directory name will be human readable, for change detection the directory name will be incomprehensibly hashed ;-).

If you're using CVS or Subversion, you cannot do checkouts as a specific user unless you're using remote agents.

Speaking of remote agents, you can run them as any user, but all builds on that agent will use the same user, which is not what you want as far as I understand.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Renan Battaglin
Published May 18, 2017 in Bamboo

FAQ: How to Upgrade Bamboo Server

Bamboo 5.9 will no longer be supported after June 12, 2017. What does this mean? As part of our End of Life policy, Atlassian supports major versions for two years after the first major iteratio...

1,436 views 0 5
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you