-
Type:
Suggestion
-
Resolution: Unresolved
-
None
-
Component/s: Administration (Projects), Agents
-
None
-
1
-
10
Problem Definition
We have a setup with a central build server and multiple remote agents on similar Linux servers.
We have a set of environment variables we need to exist when every build is run - currently:
ANT_OPTS="-XX:MaxPermSize=256m -Xmx1024m -Djava.awt.headless=true" HOSTNAME=`/bin/hostname` hostname=`/bin/hostname`
Bamboo is started by an init script, as are the remote agents, which we've deployed using the Tanuki Java Service Wrapper.
To get all our plans to build with these environment variables we either have to maintain them for each plan (we will have 100+ of these when we've rolled out fully) or use OS level fu to manage them.
Currently we're doing the latter, which involves:
- Editing /etc/profile (or another appropriate file) on the servers to declare these environment variables
- Editing the Tanuki wrapper script on the server and each remote agent to include these variables when it runs (otherwise they're lost when the service is restarted via sudo)
What we'd like to do is be able to manage these environment variables at a server (and potentially project) level to set defaults.
These would be provided to each local and remote agent when they launched the builder for a plan, but could be overridden by settings in plans.
Some of these environment variables are associated with builders (e.g. ANT_HOME), so it might be that there's also the ability to configure environment variables for builders as well as globally. This would actually give us the ability to isolate scarier variables to specific builds that needed them.
Suggested Solution
Implement environment variable management from Bamboo host to Remote agents
Workaround
You can add Environment Variables to Agents in <bamboo-agent-home>/conf/wrapper.conf using the format set.VARIABLE_NAME=variable_value.
For example, the following can be added to wrapper.conf on your agent(s):
#******************************************************************** # Environment Variables #******************************************************************** # These variables will be used by the Bamboo agent # All will start with "set" -- Format: # set.KEY=value set.VARIABLE1=value1 set.VARIABLE2=value2
See Tanuki Software Java Service Wrapper - Environment Variable Definition for more information
- mentioned in
-
Page Loading...