Agent environment variables
Set an agent environment variable with a CloudBees CD/RO server-side property instead of in the agent’s
agent/wrapper.conf file. These properties can be created under
resources objects in the custom
ec_environment_variables property sheet.
Environment variables defined in
wrapper.confare defined for both the process environment of step commands run by the agent and for the agent process itself.
If a particular environment variable is defined in both
wrapper.confand on the
ec_environment_variablesproperty sheet, then the agent process itself sees the value defined in
wrapper.confand step commands see the value defined in the property sheet.
Agent environment variables can be centrally managed by the CloudBees CD/RO server.
Environment variables can be set at the zone level for all resources from this zone or at the resource level for individiual agents. The settings at the resource level take precedent over the settings at the zone level.
Agent restart is not required in order for the new
ec_environment_variablesproperty sheet settings to take effect, which is required when applying the changes in the agent/wrapper.conf file.
Two or more resources can be created based on the same agent by defining different environment variables. Then use them independently by the executed job steps on the agent.
As best practice, use the
ec_environment_variables approach in preference to the
wrapper.conf approach to avoid introducing environment variables into the agent process itself and to avoid having to edit files on the agent and restart the agent, as noted.
For further information about properties, see Properties.
For instance, a customer has machine
agent-b installed with one CloudBees CD/RO agent that has access to the public Internet via proxy, only. To specify programs such as
wget, and so on to use a proxy, set special environment variables as a property under the appropriate CloudBees CD/RO server
HTTP proxy for all agents in the same zone,
HTTPS proxy for an individual resource,