Package jetbrains.buildServer.agent.impl
Class AgentBuildSettingsProxy<T extends AgentBuildSettings>
- java.lang.Object
-
- jetbrains.buildServer.agent.impl.AgentBuildSettingsProxy<T>
-
- All Implemented Interfaces:
AgentBuildSettings
- Direct Known Subclasses:
AgentBuildInfoImpl
,AgentRunningBuildImpl
public class AgentBuildSettingsProxy<T extends AgentBuildSettings> extends Object implements AgentBuildSettings
-
-
Constructor Summary
Constructors Constructor Description AgentBuildSettingsProxy(T host)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getAccessCode()
Returns build access code used to download artifactsString
getAccessUser()
Get user name to be used to execute authenticated requests on behalf of build to TeamCity server.BuildAgentConfiguration
getAgentConfiguration()
Build agent configuration of the build agent.File
getAgentTempDirectory()
Returns temporary directory which has the same lifecycle as build temporary directory.List<ArtifactDependencyInfo>
getArtifactDependencies()
Returns artifact dependenciesString
getBuildCurrentVersion(VcsRoot vcsRoot)
Returns current version of the specified VCS rootlong
getBuildId()
Returns id of the buildBuildProgressLogger
getBuildLogger()
Returns logger which can be used to log messages to the build log on server.String
getBuildPreviousVersion(VcsRoot vcsRoot)
Returns previous version of the specified VCS rootList<BuildRunnerSettings>
getBuildRunners()
File
getBuildTempDirectory()
Returns build temporary directory.String
getBuildTypeExternalId()
Returns external build configuration idString
getBuildTypeId()
Returns internal build configuration idString
getBuildTypeName()
Returns name of build configuration (on the moment of build starting)<T> T
getBuildTypeOptionValue(Option<T> option)
Returns value of the specified build configuration optionAgentBuild.CheckoutType
getCheckoutType()
Returns Checkout Type that was sent by server in the settings of the build.File
getDefaultCheckoutDirectory()
long
getExecutionTimeoutMinutes()
Returns build execution timeout in minutes, 0 indicates that there is no limitT
getHost()
List<VcsChangeInfo>
getPersonalVcsChanges()
Returns list of changed files modified in personal changelist (if build is non personal returns empty list)String
getProjectName()
Returns name of the project (on the moment of build starting)List<VcsChangeInfo>
getVcsChanges()
Returns list of changed files in this build (excluding files modified in personal changelist if build is personal)List<VcsRootEntry>
getVcsRootEntries()
Returns VCS root entries associated with this build, i.e.String
getVcsSettingsHashForCheckoutMode(AgentCheckoutMode agentCheckoutMode)
Returns vcs settings hash for the specified checkout mode, seeAgentRunningBuild.getEffectiveCheckoutMode()
This hash is used as a default checkout directory name if explicit checkout directory is not defined.boolean
isCheckoutOnAgent()
Returns true ifAgentBuildSettings.getCheckoutType()
returnsAgentBuild.CheckoutType.ON_AGENT
Since 10.0, this method may return false even if checkout will be performed on Agent.boolean
isCheckoutOnServer()
Returns true ifAgentBuildSettings.getCheckoutType()
returnsAgentBuild.CheckoutType.ON_SERVER
Since 10.0, this method may return false even if checkout will be performed on Server.boolean
isCleanBuild()
Returns true if files should be cleaned before buildboolean
isCustomCheckoutDirectory()
Returns true if custom checkout directory is specified.boolean
isPersonal()
Returns true if build is personalboolean
isPersonalPatchAvailable()
-
-
-
Constructor Detail
-
AgentBuildSettingsProxy
public AgentBuildSettingsProxy(@NotNull T host)
-
-
Method Detail
-
getHost
@NotNull public T getHost()
-
getAccessCode
@NotNull public final String getAccessCode()
Description copied from interface:AgentBuildSettings
Returns build access code used to download artifacts- Specified by:
getAccessCode
in interfaceAgentBuildSettings
- Returns:
- build access code
- See Also:
AgentBuildSettings.getAccessUser()
-
getAgentConfiguration
@NotNull public final BuildAgentConfiguration getAgentConfiguration()
Description copied from interface:AgentBuildSettings
Build agent configuration of the build agent.- Specified by:
getAgentConfiguration
in interfaceAgentBuildSettings
- Returns:
- build agent configuration of the build agent
-
getAgentTempDirectory
@NotNull public final File getAgentTempDirectory()
Description copied from interface:AgentBuildSettings
Returns temporary directory which has the same lifecycle as build temporary directory. Before TeamCity 2023.05: it was cleaned before the build is started (afterAgentLifeCycleListener.buildStarted(AgentRunningBuild)
, but beforeAgentLifeCycleListener.preparationFinished(AgentRunningBuild)
) Since TeamCity 2023.05: it is created and cleaned beforeAgentLifeCycleListener.buildStarted(AgentRunningBuild)
event This directory is intended to be used to store any build-related files generated by the agent plugins. This folder is not intended to be used as build process temp directory.- Specified by:
getAgentTempDirectory
in interfaceAgentBuildSettings
- Returns:
- see above
-
getArtifactDependencies
@NotNull public final List<ArtifactDependencyInfo> getArtifactDependencies()
Description copied from interface:AgentBuildSettings
Returns artifact dependencies- Specified by:
getArtifactDependencies
in interfaceAgentBuildSettings
- Returns:
- artifact dependencies
-
getAccessUser
@NotNull public String getAccessUser()
Description copied from interface:AgentBuildSettings
Get user name to be used to execute authenticated requests on behalf of build to TeamCity server. For password seeAgentBuildSettings.getAccessCode()
- Specified by:
getAccessUser
in interfaceAgentBuildSettings
- Returns:
- user name
- See Also:
AgentBuildSettings.getAccessCode()
-
getBuildCurrentVersion
public final String getBuildCurrentVersion(@NotNull VcsRoot vcsRoot)
Description copied from interface:AgentBuildSettings
Returns current version of the specified VCS root- Specified by:
getBuildCurrentVersion
in interfaceAgentBuildSettings
- Parameters:
vcsRoot
- VCS root- Returns:
- see above
-
getBuildId
public final long getBuildId()
Description copied from interface:AgentBuildSettings
Returns id of the build- Specified by:
getBuildId
in interfaceAgentBuildSettings
- Returns:
- build id
-
getBuildLogger
@NotNull public final BuildProgressLogger getBuildLogger()
Description copied from interface:AgentBuildSettings
Returns logger which can be used to log messages to the build log on server.- Specified by:
getBuildLogger
in interfaceAgentBuildSettings
- Returns:
- logger for various build messages
-
getBuildPreviousVersion
public final String getBuildPreviousVersion(@NotNull VcsRoot vcsRoot)
Description copied from interface:AgentBuildSettings
Returns previous version of the specified VCS root- Specified by:
getBuildPreviousVersion
in interfaceAgentBuildSettings
- Parameters:
vcsRoot
- VCS root- Returns:
- see above
-
getBuildTempDirectory
@NotNull public File getBuildTempDirectory()
Description copied from interface:AgentBuildSettings
Returns build temporary directory. Before TeamCity 2023.05: it was cleaned before the build is started (afterAgentLifeCycleListener.buildStarted(AgentRunningBuild)
, but beforeAgentLifeCycleListener.preparationFinished(AgentRunningBuild)
) Since TeamCity 2023.05: it is created and cleaned beforeAgentLifeCycleListener.buildStarted(AgentRunningBuild)
event It is intended to be set as temporary folder for running build process. In general build process may do whatever it need with this directory contents. Consider usingAgentBuildSettings.getAgentTempDirectory()
to store temporary files that are created by any build running code on the build agent.- Specified by:
getBuildTempDirectory
in interfaceAgentBuildSettings
- Returns:
- build temp dir
-
getBuildTypeId
@NotNull public final String getBuildTypeId()
Description copied from interface:AgentBuildSettings
Returns internal build configuration id- Specified by:
getBuildTypeId
in interfaceAgentBuildSettings
- Returns:
- internal build configuration id
-
getBuildTypeExternalId
@NotNull public String getBuildTypeExternalId()
Description copied from interface:AgentBuildSettings
Returns external build configuration id- Specified by:
getBuildTypeExternalId
in interfaceAgentBuildSettings
- Returns:
- external build configuration id
-
getBuildTypeName
public final String getBuildTypeName()
Description copied from interface:AgentBuildSettings
Returns name of build configuration (on the moment of build starting)- Specified by:
getBuildTypeName
in interfaceAgentBuildSettings
- Returns:
- name of build configuration
-
getBuildTypeOptionValue
public final <T> T getBuildTypeOptionValue(@NotNull Option<T> option)
Description copied from interface:AgentBuildSettings
Returns value of the specified build configuration option- Specified by:
getBuildTypeOptionValue
in interfaceAgentBuildSettings
- Type Parameters:
T
- type of the value- Parameters:
option
- build configuration option- Returns:
- value
-
getDefaultCheckoutDirectory
@NotNull public File getDefaultCheckoutDirectory()
- Specified by:
getDefaultCheckoutDirectory
in interfaceAgentBuildSettings
- Returns:
- default checkout directory which will be used if custom checkout directory is not specified.
-
getVcsSettingsHashForCheckoutMode
@NotNull public String getVcsSettingsHashForCheckoutMode(AgentCheckoutMode agentCheckoutMode)
Description copied from interface:AgentBuildSettings
Returns vcs settings hash for the specified checkout mode, seeAgentRunningBuild.getEffectiveCheckoutMode()
This hash is used as a default checkout directory name if explicit checkout directory is not defined.- Specified by:
getVcsSettingsHashForCheckoutMode
in interfaceAgentBuildSettings
- Parameters:
agentCheckoutMode
- how checkout will be performed
-
getBuildRunners
@NotNull public List<BuildRunnerSettings> getBuildRunners()
- Specified by:
getBuildRunners
in interfaceAgentBuildSettings
- Returns:
- list of build runners settings associated with this build
-
getExecutionTimeoutMinutes
public final long getExecutionTimeoutMinutes()
Description copied from interface:AgentBuildSettings
Returns build execution timeout in minutes, 0 indicates that there is no limit- Specified by:
getExecutionTimeoutMinutes
in interfaceAgentBuildSettings
- Returns:
- build execution timeout
-
getPersonalVcsChanges
@NotNull public final List<VcsChangeInfo> getPersonalVcsChanges()
Description copied from interface:AgentBuildSettings
Returns list of changed files modified in personal changelist (if build is non personal returns empty list)- Specified by:
getPersonalVcsChanges
in interfaceAgentBuildSettings
- Returns:
- list of changed files modified in personal changelist
-
getProjectName
public final String getProjectName()
Description copied from interface:AgentBuildSettings
Returns name of the project (on the moment of build starting)- Specified by:
getProjectName
in interfaceAgentBuildSettings
- Returns:
- name of the project
-
getVcsChanges
@NotNull public final List<VcsChangeInfo> getVcsChanges()
Description copied from interface:AgentBuildSettings
Returns list of changed files in this build (excluding files modified in personal changelist if build is personal)- Specified by:
getVcsChanges
in interfaceAgentBuildSettings
- Returns:
- list of changed files in this build (excluding personal changes)
-
getVcsRootEntries
@NotNull public final List<VcsRootEntry> getVcsRootEntries()
Description copied from interface:AgentBuildSettings
Returns VCS root entries associated with this build, i.e. build configuration VCS root entries on the moment of build starting.- Specified by:
getVcsRootEntries
in interfaceAgentBuildSettings
- Returns:
- see above
-
isCheckoutOnAgent
public final boolean isCheckoutOnAgent()
Description copied from interface:AgentBuildSettings
Returns true ifAgentBuildSettings.getCheckoutType()
returnsAgentBuild.CheckoutType.ON_AGENT
Since 10.0, this method may return false even if checkout will be performed on Agent. It is possible if checkout type setting is set to AUTO and is resolved to the Agent-Side checkout.- Specified by:
isCheckoutOnAgent
in interfaceAgentBuildSettings
- See Also:
AgentBuildSettings.getCheckoutType()
-
isCheckoutOnServer
public final boolean isCheckoutOnServer()
Description copied from interface:AgentBuildSettings
Returns true ifAgentBuildSettings.getCheckoutType()
returnsAgentBuild.CheckoutType.ON_SERVER
Since 10.0, this method may return false even if checkout will be performed on Server. It is possible if checkout type setting is set to AUTO and is resolved to the Server-Side checkout.- Specified by:
isCheckoutOnServer
in interfaceAgentBuildSettings
- See Also:
AgentBuildSettings.getCheckoutType()
-
getCheckoutType
@NotNull public AgentBuild.CheckoutType getCheckoutType()
Description copied from interface:AgentBuildSettings
Returns Checkout Type that was sent by server in the settings of the build.- Specified by:
getCheckoutType
in interfaceAgentBuildSettings
- See Also:
AgentRunningBuild.getEffectiveCheckoutMode()
-
isCleanBuild
public final boolean isCleanBuild()
Description copied from interface:AgentBuildSettings
Returns true if files should be cleaned before build- Specified by:
isCleanBuild
in interfaceAgentBuildSettings
- Returns:
- see above
-
isCustomCheckoutDirectory
public final boolean isCustomCheckoutDirectory()
Description copied from interface:AgentBuildSettings
Returns true if custom checkout directory is specified.- Specified by:
isCustomCheckoutDirectory
in interfaceAgentBuildSettings
- Returns:
- true if custom checkout directory is specified
-
isPersonal
public final boolean isPersonal()
Description copied from interface:AgentBuildSettings
Returns true if build is personal- Specified by:
isPersonal
in interfaceAgentBuildSettings
- Returns:
- see above
-
isPersonalPatchAvailable
public boolean isPersonalPatchAvailable()
- Specified by:
isPersonalPatchAvailable
in interfaceAgentBuildSettings
- Returns:
- true if this personal build has personal patch.
-
-