Run as different user on remote bamboo agent?

Brent Villalobos
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 22, 2012

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 votes
Answer accepted
Przemek Bruski
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 23, 2012

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
TAGS
AUG Leaders

Atlassian Community Events