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

This widget could not be displayed.

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
Community showcase
Posted Tuesday in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

140 views 1 3
Join discussion

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