Package jetbrains.buildServer.agent
Interface AgentBuildSettings
-
- All Known Subinterfaces:
AgentBuildInfo
,AgentRunningBuild
public interface AgentBuildSettings
- Since:
- 6.0
- Author:
- Eugene Petrenko
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description java.lang.String
getAccessCode()
Returns build access code used to download artifactsjava.lang.String
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.java.io.File
getAgentTempDirectory()
Returns temporary directory which has the same lifecycle as build temporary directory.java.util.List<ArtifactDependencyInfo>
getArtifactDependencies()
Returns artifact dependenciesjava.lang.String
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.java.lang.String
getBuildPreviousVersion(VcsRoot vcsRoot)
Deprecated.see jetbrains.buildServer.agent.impl.vcs.AgentWorkDirRevisionManager#getCurrentState(jetbrains.buildServer.agent.AgentRunningBuild)java.util.List<BuildRunnerSettings>
getBuildRunners()
java.io.File
getBuildTempDirectory()
Returns build temporary directory.java.lang.String
getBuildTypeExternalId()
Returns external build configuration idjava.lang.String
getBuildTypeId()
Returns internal build configuration idjava.lang.String
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.java.io.File
getDefaultCheckoutDirectory()
Deprecated.since 10.0.long
getExecutionTimeoutMinutes()
Returns build execution timeout in minutes, 0 indicates that there is no limitjava.util.List<VcsChangeInfo>
getPersonalVcsChanges()
Returns list of changed files modified in personal changelist (if build is non personal returns empty list)java.lang.String
getProjectName()
Returns name of the project (on the moment of build starting)java.util.List<VcsChangeInfo>
getVcsChanges()
Returns list of changed files in this build (excluding files modified in personal changelist if build is personal)java.util.List<VcsRootEntry>
getVcsRootEntries()
Returns VCS root entries associated with this build, i.e.java.lang.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 ifgetCheckoutType()
returnsAgentBuild.CheckoutType.ON_AGENT
Since 10.0, this method may return false even if checkout will be performed on Agent.boolean
isCheckoutOnServer()
Returns true ifgetCheckoutType()
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()
-
-
-
Method Detail
-
getProjectName
java.lang.String getProjectName()
Returns name of the project (on the moment of build starting)- Returns:
- name of the project
- Since:
- 4.0
-
getBuildTypeId
@NotNull java.lang.String getBuildTypeId()
Returns internal build configuration id- Returns:
- internal build configuration id
- Since:
- 4.0
-
getBuildTypeExternalId
@NotNull java.lang.String getBuildTypeExternalId()
Returns external build configuration id- Returns:
- external build configuration id
- Since:
- 8.1
-
getBuildTypeName
java.lang.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_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.- Since:
- 4.0
- See Also:
getCheckoutType()
-
isCheckoutOnServer
boolean isCheckoutOnServer()
Returns true ifgetCheckoutType()
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.- 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 java.util.List<ArtifactDependencyInfo> getArtifactDependencies()
Returns artifact dependencies- Returns:
- artifact dependencies
- Since:
- 4.0
-
getAccessUser
@NotNull java.lang.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 java.lang.String getAccessCode()
Returns build access code used to download artifacts- Returns:
- build access code
- Since:
- 4.0
- See Also:
getAccessUser()
-
getVcsRootEntries
@NotNull java.util.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
java.lang.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 java.lang.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 java.util.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 java.util.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 java.io.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 java.io.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 java.io.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 java.lang.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 java.util.List<BuildRunnerSettings> getBuildRunners()
- Returns:
- list of build runners settings associated with this build
- Since:
- 2017.2
-
-