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 StringgetAccessCode()Returns build access code used to download artifactsStringgetAccessUser()Get user name to be used to execute authenticated requests on behalf of build to TeamCity server.BuildAgentConfigurationgetAgentConfiguration()Build agent configuration of the build agent.FilegetAgentTempDirectory()Returns temporary directory which has the same lifecycle as build temporary directory.List<ArtifactDependencyInfo>getArtifactDependencies()Returns artifact dependenciesStringgetBuildCurrentVersion(VcsRoot vcsRoot)Returns current version of the specified VCS rootlonggetBuildId()Returns id of the buildBuildProgressLoggergetBuildLogger()Returns logger which can be used to log messages to the build log on server.StringgetBuildPreviousVersion(VcsRoot vcsRoot)Returns previous version of the specified VCS rootList<BuildRunnerSettings>getBuildRunners()FilegetBuildTempDirectory()Returns build temporary directory.StringgetBuildTypeExternalId()Returns external build configuration idStringgetBuildTypeId()Returns internal build configuration idStringgetBuildTypeName()Returns name of build configuration (on the moment of build starting)<T> TgetBuildTypeOptionValue(Option<T> option)Returns value of the specified build configuration optionAgentBuild.CheckoutTypegetCheckoutType()Returns Checkout Type that was sent by server in the settings of the build.FilegetDefaultCheckoutDirectory()longgetExecutionTimeoutMinutes()Returns build execution timeout in minutes, 0 indicates that there is no limitTgetHost()List<VcsChangeInfo>getPersonalVcsChanges()Returns list of changed files modified in personal changelist (if build is non personal returns empty list)StringgetProjectName()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.StringgetVcsSettingsHashForCheckoutMode(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.booleanisCheckoutOnAgent()Returns true ifAgentBuildSettings.getCheckoutType()returnsAgentBuild.CheckoutType.ON_AGENTSince 10.0, this method may return false even if checkout will be performed on Agent.booleanisCheckoutOnServer()Returns true ifAgentBuildSettings.getCheckoutType()returnsAgentBuild.CheckoutType.ON_SERVERSince 10.0, this method may return false even if checkout will be performed on Server.booleanisCleanBuild()Returns true if files should be cleaned before buildbooleanisCustomCheckoutDirectory()Returns true if custom checkout directory is specified.booleanisPersonal()Returns true if build is personalbooleanisPersonalPatchAvailable()
-
-
-
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:AgentBuildSettingsReturns build access code used to download artifacts- Specified by:
getAccessCodein interfaceAgentBuildSettings- Returns:
- build access code
- See Also:
AgentBuildSettings.getAccessUser()
-
getAgentConfiguration
@NotNull public final BuildAgentConfiguration getAgentConfiguration()
Description copied from interface:AgentBuildSettingsBuild agent configuration of the build agent.- Specified by:
getAgentConfigurationin interfaceAgentBuildSettings- Returns:
- build agent configuration of the build agent
-
getAgentTempDirectory
@NotNull public final File getAgentTempDirectory()
Description copied from interface:AgentBuildSettingsReturns 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:
getAgentTempDirectoryin interfaceAgentBuildSettings- Returns:
- see above
-
getArtifactDependencies
@NotNull public final List<ArtifactDependencyInfo> getArtifactDependencies()
Description copied from interface:AgentBuildSettingsReturns artifact dependencies- Specified by:
getArtifactDependenciesin interfaceAgentBuildSettings- Returns:
- artifact dependencies
-
getAccessUser
@NotNull public String getAccessUser()
Description copied from interface:AgentBuildSettingsGet user name to be used to execute authenticated requests on behalf of build to TeamCity server. For password seeAgentBuildSettings.getAccessCode()- Specified by:
getAccessUserin interfaceAgentBuildSettings- Returns:
- user name
- See Also:
AgentBuildSettings.getAccessCode()
-
getBuildCurrentVersion
public final String getBuildCurrentVersion(@NotNull VcsRoot vcsRoot)
Description copied from interface:AgentBuildSettingsReturns current version of the specified VCS root- Specified by:
getBuildCurrentVersionin interfaceAgentBuildSettings- Parameters:
vcsRoot- VCS root- Returns:
- see above
-
getBuildId
public final long getBuildId()
Description copied from interface:AgentBuildSettingsReturns id of the build- Specified by:
getBuildIdin interfaceAgentBuildSettings- Returns:
- build id
-
getBuildLogger
@NotNull public final BuildProgressLogger getBuildLogger()
Description copied from interface:AgentBuildSettingsReturns logger which can be used to log messages to the build log on server.- Specified by:
getBuildLoggerin interfaceAgentBuildSettings- Returns:
- logger for various build messages
-
getBuildPreviousVersion
public final String getBuildPreviousVersion(@NotNull VcsRoot vcsRoot)
Description copied from interface:AgentBuildSettingsReturns previous version of the specified VCS root- Specified by:
getBuildPreviousVersionin interfaceAgentBuildSettings- Parameters:
vcsRoot- VCS root- Returns:
- see above
-
getBuildTempDirectory
@NotNull public File getBuildTempDirectory()
Description copied from interface:AgentBuildSettingsReturns 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:
getBuildTempDirectoryin interfaceAgentBuildSettings- Returns:
- build temp dir
-
getBuildTypeId
@NotNull public final String getBuildTypeId()
Description copied from interface:AgentBuildSettingsReturns internal build configuration id- Specified by:
getBuildTypeIdin interfaceAgentBuildSettings- Returns:
- internal build configuration id
-
getBuildTypeExternalId
@NotNull public String getBuildTypeExternalId()
Description copied from interface:AgentBuildSettingsReturns external build configuration id- Specified by:
getBuildTypeExternalIdin interfaceAgentBuildSettings- Returns:
- external build configuration id
-
getBuildTypeName
public final String getBuildTypeName()
Description copied from interface:AgentBuildSettingsReturns name of build configuration (on the moment of build starting)- Specified by:
getBuildTypeNamein interfaceAgentBuildSettings- Returns:
- name of build configuration
-
getBuildTypeOptionValue
public final <T> T getBuildTypeOptionValue(@NotNull Option<T> option)Description copied from interface:AgentBuildSettingsReturns value of the specified build configuration option- Specified by:
getBuildTypeOptionValuein interfaceAgentBuildSettings- Type Parameters:
T- type of the value- Parameters:
option- build configuration option- Returns:
- value
-
getDefaultCheckoutDirectory
@NotNull public File getDefaultCheckoutDirectory()
- Specified by:
getDefaultCheckoutDirectoryin 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:AgentBuildSettingsReturns 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:
getVcsSettingsHashForCheckoutModein interfaceAgentBuildSettings- Parameters:
agentCheckoutMode- how checkout will be performed
-
getBuildRunners
@NotNull public List<BuildRunnerSettings> getBuildRunners()
- Specified by:
getBuildRunnersin interfaceAgentBuildSettings- Returns:
- list of build runners settings associated with this build
-
getExecutionTimeoutMinutes
public final long getExecutionTimeoutMinutes()
Description copied from interface:AgentBuildSettingsReturns build execution timeout in minutes, 0 indicates that there is no limit- Specified by:
getExecutionTimeoutMinutesin interfaceAgentBuildSettings- Returns:
- build execution timeout
-
getPersonalVcsChanges
@NotNull public final List<VcsChangeInfo> getPersonalVcsChanges()
Description copied from interface:AgentBuildSettingsReturns list of changed files modified in personal changelist (if build is non personal returns empty list)- Specified by:
getPersonalVcsChangesin interfaceAgentBuildSettings- Returns:
- list of changed files modified in personal changelist
-
getProjectName
public final String getProjectName()
Description copied from interface:AgentBuildSettingsReturns name of the project (on the moment of build starting)- Specified by:
getProjectNamein interfaceAgentBuildSettings- Returns:
- name of the project
-
getVcsChanges
@NotNull public final List<VcsChangeInfo> getVcsChanges()
Description copied from interface:AgentBuildSettingsReturns list of changed files in this build (excluding files modified in personal changelist if build is personal)- Specified by:
getVcsChangesin interfaceAgentBuildSettings- Returns:
- list of changed files in this build (excluding personal changes)
-
getVcsRootEntries
@NotNull public final List<VcsRootEntry> getVcsRootEntries()
Description copied from interface:AgentBuildSettingsReturns VCS root entries associated with this build, i.e. build configuration VCS root entries on the moment of build starting.- Specified by:
getVcsRootEntriesin interfaceAgentBuildSettings- Returns:
- see above
-
isCheckoutOnAgent
public final boolean isCheckoutOnAgent()
Description copied from interface:AgentBuildSettingsReturns true ifAgentBuildSettings.getCheckoutType()returnsAgentBuild.CheckoutType.ON_AGENTSince 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:
isCheckoutOnAgentin interfaceAgentBuildSettings- See Also:
AgentBuildSettings.getCheckoutType()
-
isCheckoutOnServer
public final boolean isCheckoutOnServer()
Description copied from interface:AgentBuildSettingsReturns true ifAgentBuildSettings.getCheckoutType()returnsAgentBuild.CheckoutType.ON_SERVERSince 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:
isCheckoutOnServerin interfaceAgentBuildSettings- See Also:
AgentBuildSettings.getCheckoutType()
-
getCheckoutType
@NotNull public AgentBuild.CheckoutType getCheckoutType()
Description copied from interface:AgentBuildSettingsReturns Checkout Type that was sent by server in the settings of the build.- Specified by:
getCheckoutTypein interfaceAgentBuildSettings- See Also:
AgentRunningBuild.getEffectiveCheckoutMode()
-
isCleanBuild
public final boolean isCleanBuild()
Description copied from interface:AgentBuildSettingsReturns true if files should be cleaned before build- Specified by:
isCleanBuildin interfaceAgentBuildSettings- Returns:
- see above
-
isCustomCheckoutDirectory
public final boolean isCustomCheckoutDirectory()
Description copied from interface:AgentBuildSettingsReturns true if custom checkout directory is specified.- Specified by:
isCustomCheckoutDirectoryin interfaceAgentBuildSettings- Returns:
- true if custom checkout directory is specified
-
isPersonal
public final boolean isPersonal()
Description copied from interface:AgentBuildSettingsReturns true if build is personal- Specified by:
isPersonalin interfaceAgentBuildSettings- Returns:
- see above
-
isPersonalPatchAvailable
public boolean isPersonalPatchAvailable()
- Specified by:
isPersonalPatchAvailablein interfaceAgentBuildSettings- Returns:
- true if this personal build has personal patch.
-
-