Package jetbrains.buildServer.agent
Interface AgentBuildSettings
-
- All Known Subinterfaces:
AgentBuildInfo,AgentBuildSettingsEx,AgentRunningBuild,AgentRunningBuildEx
- All Known Implementing Classes:
AgentBuildInfoImpl,AgentBuildSettingsImpl,AgentBuildSettingsProxy,AgentRunningBuildImpl
public interface AgentBuildSettings- Since:
- 6.0
- Author:
- Eugene Petrenko
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated 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)Deprecated.see jetbrains.buildServer.agent.impl.vcs.AgentWorkDirRevisionManager#getCurrentState(jetbrains.buildServer.agent.AgentRunningBuild)List<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()Deprecated.since 10.0.longgetExecutionTimeoutMinutes()Returns build execution timeout in minutes, 0 indicates that there is no limitList<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 ifgetCheckoutType()returnsAgentBuild.CheckoutType.ON_AGENTSince 10.0, this method may return false even if checkout will be performed on Agent.booleanisCheckoutOnServer()Returns true ifgetCheckoutType()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()
-
-
-
Method Detail
-
getProjectName
String getProjectName()
Returns name of the project (on the moment of build starting)- Returns:
- name of the project
- Since:
- 4.0
-
getBuildTypeId
@NotNull String getBuildTypeId()
Returns internal build configuration id- Returns:
- internal build configuration id
- Since:
- 4.0
-
getBuildTypeExternalId
@NotNull String getBuildTypeExternalId()
Returns external build configuration id- Returns:
- external build configuration id
- Since:
- 8.1
-
getBuildTypeName
String getBuildTypeName()
Returns name of build configuration (on the moment of build starting)- Returns:
- name of build configuration
- Since:
- 4.0
-
getBuildId
long getBuildId()
Returns id of the build- Returns:
- build id
- Since:
- 4.0
-
isCleanBuild
boolean isCleanBuild()
Returns true if files should be cleaned before build- Returns:
- see above
- Since:
- 4.0
-
isPersonal
boolean isPersonal()
Returns true if build is personal- Returns:
- see above
- Since:
- 4.0
-
isPersonalPatchAvailable
boolean isPersonalPatchAvailable()
- Returns:
- true if this personal build has personal patch.
- Since:
- 6.5
-
isCheckoutOnAgent
boolean isCheckoutOnAgent()
Returns true ifgetCheckoutType()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.- Since:
- 4.0
- See Also:
getCheckoutType()
-
isCheckoutOnServer
boolean isCheckoutOnServer()
Returns true ifgetCheckoutType()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.- Since:
- 4.0
- See Also:
getCheckoutType()
-
getCheckoutType
@NotNull AgentBuild.CheckoutType getCheckoutType()
Returns Checkout Type that was sent by server in the settings of the build.
-
getExecutionTimeoutMinutes
long getExecutionTimeoutMinutes()
Returns build execution timeout in minutes, 0 indicates that there is no limit- Returns:
- build execution timeout
- Since:
- 4.0
-
getArtifactDependencies
@NotNull List<ArtifactDependencyInfo> getArtifactDependencies()
Returns artifact dependencies- Returns:
- artifact dependencies
- Since:
- 4.0
-
getAccessUser
@NotNull String getAccessUser()
Get user name to be used to execute authenticated requests on behalf of build to TeamCity server. For password seegetAccessCode()- Returns:
- user name
- Since:
- 7.1
- See Also:
getAccessCode()
-
getAccessCode
@NotNull String getAccessCode()
Returns build access code used to download artifacts- Returns:
- build access code
- Since:
- 4.0
- See Also:
getAccessUser()
-
getVcsRootEntries
@NotNull List<VcsRootEntry> getVcsRootEntries()
Returns VCS root entries associated with this build, i.e. build configuration VCS root entries on the moment of build starting.- Returns:
- see above
- Since:
- 4.0
-
getBuildCurrentVersion
String getBuildCurrentVersion(@NotNull VcsRoot vcsRoot)
Returns current version of the specified VCS root- Parameters:
vcsRoot- VCS root- Returns:
- see above
- Since:
- 4.0
-
getBuildPreviousVersion
@Deprecated String getBuildPreviousVersion(@NotNull VcsRoot vcsRoot)
Deprecated.see jetbrains.buildServer.agent.impl.vcs.AgentWorkDirRevisionManager#getCurrentState(jetbrains.buildServer.agent.AgentRunningBuild)Returns previous version of the specified VCS root- Parameters:
vcsRoot- VCS root- Returns:
- see above
- Since:
- 4.0
-
isCustomCheckoutDirectory
boolean isCustomCheckoutDirectory()
Returns true if custom checkout directory is specified.- Returns:
- true if custom checkout directory is specified
- Since:
- 4.0
-
getVcsChanges
@NotNull List<VcsChangeInfo> getVcsChanges()
Returns list of changed files in this build (excluding files modified in personal changelist if build is personal)- Returns:
- list of changed files in this build (excluding personal changes)
- Since:
- 4.0
-
getPersonalVcsChanges
@NotNull List<VcsChangeInfo> getPersonalVcsChanges()
Returns list of changed files modified in personal changelist (if build is non personal returns empty list)- Returns:
- list of changed files modified in personal changelist
- Since:
- 4.0
-
getBuildTempDirectory
@NotNull File getBuildTempDirectory()
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 usinggetAgentTempDirectory()to store temporary files that are created by any build running code on the build agent.- Returns:
- build temp dir
- Since:
- 4.0
-
getAgentTempDirectory
@NotNull File getAgentTempDirectory()
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.- Returns:
- see above
- Since:
- 4.0
-
getBuildLogger
@NotNull BuildProgressLogger getBuildLogger()
Returns logger which can be used to log messages to the build log on server.- Returns:
- logger for various build messages
- Since:
- 4.0
-
getAgentConfiguration
@NotNull BuildAgentConfiguration getAgentConfiguration()
Build agent configuration of the build agent.- Returns:
- build agent configuration of the build agent
- Since:
- 4.0
-
getBuildTypeOptionValue
<T> T getBuildTypeOptionValue(@NotNull Option<T> option)Returns value of the specified build configuration option- Type Parameters:
T- type of the value- Parameters:
option- build configuration option- Returns:
- value
- Since:
- 4.5
-
getDefaultCheckoutDirectory
@Deprecated @NotNull File getDefaultCheckoutDirectory()
Deprecated.since 10.0. Default checkout directory name is equal to the vcs settings hash that depends on effective checkout mode, usegetVcsSettingsHashForCheckoutMode(AgentCheckoutMode)- Returns:
- default checkout directory which will be used if custom checkout directory is not specified.
- Since:
- 7.0
-
getVcsSettingsHashForCheckoutMode
@NotNull 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.- Parameters:
agentCheckoutMode- how checkout will be performed- Since:
- 10.0
-
getBuildRunners
@NotNull List<BuildRunnerSettings> getBuildRunners()
- Returns:
- list of build runners settings associated with this build
- Since:
- 2017.2
-
-