Package jetbrains.buildServer.agent
Interface BuildAgentConfiguration
-
- All Known Subinterfaces:
BuildAgentConfigurationEx
- All Known Implementing Classes:
BuildAgentConfigurationImpl
public interface BuildAgentConfigurationRepresents configuration of build agent (loaded from buildAgent.properties file)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description voidaddAlternativeAgentAddress(String address)Adds alternative agent address that may be used by the server to communicate with agent.voidaddConfigurationParameter(String key, String value)Adds all-builds wide configuration parameter.voidaddCustomProperty(String name, String value)voidaddEnvironmentVariable(String key, String value)Adds all-builds wide environment variable.voidaddSystemProperty(String key, String value)Adds all-builds wide system property.FilegetAgentHomeDirectory()FilegetAgentLibDirectory()FilegetAgentLogsDirectory()Returns directory containing agent log filesFilegetAgentPluginsDirectory()FilegetAgentTempDirectory()Deprecated.FilegetAgentToolsDirectory()Provides path to tools folder on build agent.FilegetAgentUpdateDirectory()StringgetAuthorizationToken()Returns agent authorization token which should be used to authorize build agentBuildParametersMapgetBuildParameters()Returns build parameters.FilegetBuildTempDirectory()Deprecated.FilegetCacheDirectory(String key)Returns path to a folder under agent's system directory by a key.Map<String,String>getConfigurationParameters()Returns configuration parameters of this buildMap<String,String>getCustomProperties()Deprecated.StringgetName()Returns name of the agentdefault AgentOperationModegetOperationMode()Returns agent's current operation mode.StringgetOwnAddress()Returns IP address where agent accepts commands from the serverintgetOwnPort()Returns port where agent accepts commands from the serverValueResolvergetParametersResolver()Creates value resolver for parameters resolution in strings.StringgetPingCode()Returns the code to be returned from the ping methodintgetServerConnectionTimeout()Returns connection timeout in seconds.StringgetServerUrl()Returns server URLFilegetSystemDirectory()Returns path to a folder containing all system caches.BuildAgentSystemInfogetSystemInfo()Returns agent jvm(system) informationFilegetTempDirectory()Returns path to temp directory: parent folder of agent temp directory and build temp directory By default it returns INSTALL_DIR/temp, but that may be changes in buildAgent.properties file.FilegetWorkDirectory()Returns path to AGENT_INSTALL_DIR/work directorybooleanremoveConfigurationParameter(String key)Remove build agent configuration parameter added via @code(addConfigurationParameter) method.
-
-
-
Method Detail
-
getName
String getName()
Returns name of the agent- Returns:
- name of the agent
-
getOwnPort
int getOwnPort()
Returns port where agent accepts commands from the server- Returns:
- see above
-
getOwnAddress
String getOwnAddress()
Returns IP address where agent accepts commands from the server- Returns:
- see above
-
getServerUrl
String getServerUrl()
Returns server URL- Returns:
- server URL
-
getAuthorizationToken
@NotNull String getAuthorizationToken()
Returns agent authorization token which should be used to authorize build agent- Returns:
- agent authorization token which should be used to authorize build agent
-
getPingCode
@NotNull String getPingCode()
Returns the code to be returned from the ping method- Returns:
- see above
-
getWorkDirectory
@NotNull File getWorkDirectory()
Returns path to AGENT_INSTALL_DIR/work directory- Returns:
- see above
-
getBuildTempDirectory
@NotNull File getBuildTempDirectory()
Deprecated.Returns path to a folder undergetTempDirectory(). This folder is cleaned before build is started.- Returns:
- see above
-
getAgentTempDirectory
@Deprecated @NotNull File getAgentTempDirectory()
Deprecated.Returns path to a folder undergetTempDirectory(). This folder is cleaned before build is started.- Returns:
- file to agent's temp dir. All temp files of agent should be put under that folder
-
getAgentToolsDirectory
@NotNull File getAgentToolsDirectory()
Provides path to tools folder on build agent. Returned folder is an existing path on the disk.- Returns:
- path to agent tools folder
- Since:
- 6.5
-
getCacheDirectory
@NotNull File getCacheDirectory(@NotNull String key)
Returns path to a folder under agent's system directory by a key. It is guaranteed the folder exists. Use this folder to store some persistent data on the agent. Note: No cleaning is performed by the agent!- Parameters:
key- plugin unique key- Returns:
- path to a directory
- Since:
- 5.0
-
getSystemDirectory
@NotNull File getSystemDirectory()
Returns path to a folder containing all system caches.- Returns:
- see above
- Since:
- 8.1.1
-
getTempDirectory
@NotNull File getTempDirectory()
Returns path to temp directory: parent folder of agent temp directory and build temp directory By default it returns INSTALL_DIR/temp, but that may be changes in buildAgent.properties file.- Returns:
- see above
-
getAgentLibDirectory
@NotNull File getAgentLibDirectory()
- Returns:
- returns path to agent's lib dir
-
getAgentPluginsDirectory
@NotNull File getAgentPluginsDirectory()
- Returns:
- path to agent's plugins dir
-
getAgentUpdateDirectory
@NotNull File getAgentUpdateDirectory()
- Returns:
- path to agent's update dir
-
getAgentHomeDirectory
@NotNull File getAgentHomeDirectory()
- Returns:
- path to agent home
-
getAgentLogsDirectory
@NotNull File getAgentLogsDirectory()
Returns directory containing agent log files- Returns:
- directory containing agent log files
-
getSystemInfo
@NotNull BuildAgentSystemInfo getSystemInfo()
Returns agent jvm(system) information- Returns:
- agent jvm(system) information
-
getServerConnectionTimeout
int getServerConnectionTimeout()
Returns connection timeout in seconds. This timeout should be specified to all HTTP connections to the server.- Returns:
- see above.
-
addAlternativeAgentAddress
void addAlternativeAgentAddress(@NotNull String address)Adds alternative agent address that may be used by the server to communicate with agent.- Parameters:
address- ip address- Since:
- 5.1
-
getCustomProperties
@NotNull @Deprecated Map<String,String> getCustomProperties()
Deprecated.Returns map of custom properties (defined in buildAgent.properties file and added by extensions). The property names are normally prefixed with env. and system.- Returns:
- map of custom properties
-
addCustomProperty
@Deprecated void addCustomProperty(@NotNull String name, @NotNull String value)
Deprecated.Adds new custom property to the configuration- Parameters:
name- property namevalue- property value
-
addSystemProperty
void addSystemProperty(@NotNull String key, @NotNull String value)Adds all-builds wide system property. Creates build parameters withConstants.SYSTEM_PREFIXprefix Modifications will be available for all builds on this agent- Parameters:
key- property name (without the "system." prefix)value- property value- Since:
- 6.0
-
addEnvironmentVariable
void addEnvironmentVariable(@NotNull String key, @NotNull String value)Adds all-builds wide environment variable. Creates build parameters withConstants.ENV_PREFIXprefix Note, on Windows machines environment size can be limited. Modifications will be available for all builds on this agent- Parameters:
key- name (without the "env." prefix), may be case sensitive or not depending on OSvalue- value- Since:
- 6.0
-
addConfigurationParameter
void addConfigurationParameter(@NotNull String key, @NotNull String value)Adds all-builds wide configuration parameter. Modifications will be available for all builds on this agent- Parameters:
key- namevalue- value- Since:
- 6.0
-
removeConfigurationParameter
boolean removeConfigurationParameter(@NotNull String key)Remove build agent configuration parameter added via @code(addConfigurationParameter) method. Will not remove parameter specified in buildAgent.properties file.- Parameters:
key- name- Returns:
- true if parameter was actually deleted, false otherwise (e.g parameter doesn't exist or is specified in buildAgent.properties file)
- Since:
- 2017.1
-
getBuildParameters
@NotNull BuildParametersMap getBuildParameters()
Returns build parameters. Some of values may not be fully resolved.- Returns:
- build-wide build parameters
- Since:
- 6.0
-
getConfigurationParameters
@NotNull Map<String,String> getConfigurationParameters()
Returns configuration parameters of this build- Returns:
- unmodifiable configuration parameters map
- Since:
- 6.0
-
getParametersResolver
@NotNull ValueResolver getParametersResolver()
Creates value resolver for parameters resolution in strings. The resolution rules are the same as for build parameters- Returns:
- value resolver to perform resolution of all parameters references within string
- Since:
- 6.0
-
getOperationMode
@NotNull default AgentOperationMode getOperationMode()
Returns agent's current operation mode. SeeAgentOperationMode- Returns:
-
-