Package jetbrains.buildServer.agent
Interface AgentRunningBuildEx
-
- All Superinterfaces:
AgentBuildSettings
,AgentRunningBuild
,Loggable
- All Known Implementing Classes:
AgentRunningBuildImpl
public interface AgentRunningBuildEx extends AgentRunningBuild
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description boolean
cleanCheckoutEnforced()
Indicates whether clean checkout was enforced for a build in designated directoryvoid
cleanParameters()
void
clearCheckoutDirRevisions()
Deletes information about checkout directory revisions preparing directory for clean checkout.BuildContextEx
getBuildContext()
BuildLogTail
getBuildLogTail()
AgentCheckoutDirRevisionInfo
getCheckoutDirRevisionInfo()
BuildRunnerContextEx
getCurrentRunnerContext()
FullCheckoutFlag
getFullCheckoutFlag()
BuildInterruptDetails
getInterruptDetails()
ControlDescription
getParameterControlDescription(String name)
Returns description object for the corresponding parameter if it is known on the agent.String
getParameterSpec(String name)
Deprecated.usegetParameterControlDescription(String)
instead<T> T
getPerBuildService(Class<T> clazz)
Service locator for per-build componentsList<BuildRunnerSettings>
getRunnersToExecute()
Map<String,String>
getUnresolvedServerParameters()
Return a map of all parameters which came from the TeamCity serverString
getVcsSettingsHash()
Returns hash of all vcs instance settings.boolean
isCheckoutDirDirty()
Returns the "dirty" status of the checkout directory.boolean
isDetachedFromAgent()
Return detached status of the agent.boolean
isPreparationDone()
boolean
relyOnVcsToRestoreFromErrors()
void
selectRunnerState(BuildRunnerSettings settings)
void
setBuildRunnerToExecute(int buildRunnerToExecute)
Sets the number of runner to execute a build step (used for purposes of Executor Mode)void
setCheckoutDirDirty(boolean checkoutDirDirty)
Depending oncheckoutDirDirty
value, marks checkout directory as either clean or dirty, both on agent and on server.void
setDefaultCheckoutDirectory(AgentCheckoutMode checkoutMode)
Set default checkout directory based on checkout mode that will be used in this build.void
setDetachedFromAgent(boolean detached)
Make the agent be detacheced/attached to some build.void
setInAlwaysExecutingStage(boolean enable)
void
setPreparationDone()
void
setResolvedCheckoutMode(AgentCheckoutMode resolvedCheckoutMode)
Set checkout method that will be used in this build.void
updateBuildNumber(String newBuildNumber)
-
Methods inherited from interface jetbrains.buildServer.agent.AgentBuildSettings
getAccessCode, getAccessUser, getAgentConfiguration, getAgentTempDirectory, getArtifactDependencies, getBuildCurrentVersion, getBuildId, getBuildLogger, getBuildPreviousVersion, getBuildRunners, getBuildTempDirectory, getBuildTypeExternalId, getBuildTypeId, getBuildTypeName, getBuildTypeOptionValue, getCheckoutType, getDefaultCheckoutDirectory, getExecutionTimeoutMinutes, getPersonalVcsChanges, getProjectName, getVcsChanges, getVcsRootEntries, getVcsSettingsHashForCheckoutMode, isCheckoutOnAgent, isCheckoutOnServer, isCleanBuild, isCustomCheckoutDirectory, isPersonal, isPersonalPatchAvailable
-
Methods inherited from interface jetbrains.buildServer.agent.AgentRunningBuild
addSharedConfigParameter, addSharedEnvironmentVariable, addSharedSystemProperty, getArtifactsPaths, getArtifactStorageSettings, getBuildFeatures, getBuildFeaturesOfType, getBuildNumber, getBuildParameters, getCheckoutDirectory, getEffectiveCheckoutMode, getFailBuildOnExitCode, getInterruptReason, getNodeIdHolder, getPasswordReplacer, getRunnerParameters, getSharedBuildParameters, getSharedConfigParameters, getSharedParametersResolver, getWorkingDirectory, interruptBuild, isBuildFailingOnServer, isInAlwaysExecutingStage, stopBuild
-
-
-
-
Method Detail
-
relyOnVcsToRestoreFromErrors
boolean relyOnVcsToRestoreFromErrors()
- Returns:
- true if agent-side checkout is used and an option to rely on VCS to restore from errors is set
- Since:
- 9.1.4
-
getCurrentRunnerContext
@NotNull BuildRunnerContextEx getCurrentRunnerContext()
- Returns:
- build context. This context is shared between all build runners
BuildRunnerContext
of the build. You may use this context to read/write build-wide parameters. Every time this method returns same object reference.BuildRunnerContext
interface may be used to update parameters for one build runner. - Since:
- 6.0
- See Also:
BuildRunnerContext
-
getBuildContext
@NotNull BuildContextEx getBuildContext()
- Since:
- 6.0
-
updateBuildNumber
void updateBuildNumber(@NotNull String newBuildNumber)
-
selectRunnerState
void selectRunnerState(@NotNull BuildRunnerSettings settings)
-
setPreparationDone
void setPreparationDone()
-
isPreparationDone
boolean isPreparationDone()
-
getPerBuildService
@Nullable <T> T getPerBuildService(Class<T> clazz)
Service locator for per-build components- Type Parameters:
T
- type if instance- Parameters:
clazz
- class of component to return- Returns:
- per-build component instance
- Since:
- 6.0
-
getFullCheckoutFlag
@NotNull FullCheckoutFlag getFullCheckoutFlag()
-
setInAlwaysExecutingStage
void setInAlwaysExecutingStage(boolean enable)
-
getVcsSettingsHash
@NotNull String getVcsSettingsHash()
Returns hash of all vcs instance settings. Required to determine on agent side whether vcs settings were changed or not.- Returns:
- hash of all vcs settings.
- Since:
- 8.1
-
getCheckoutDirRevisionInfo
@NotNull AgentCheckoutDirRevisionInfo getCheckoutDirRevisionInfo()
- Returns:
- build checkout directory revision information
- Since:
- 8.1
-
cleanCheckoutEnforced
boolean cleanCheckoutEnforced()
Indicates whether clean checkout was enforced for a build in designated directory- Returns:
- true if we should do a clean checkout
- Since:
- 8.1
-
setCheckoutDirDirty
void setCheckoutDirDirty(boolean checkoutDirDirty) throws RecoverableStageFailure, RunBuildException
Depending on
checkoutDirDirty
value, marks checkout directory as either clean or dirty, both on agent and on server.If
checkoutDirDirty
istrue
, version information of checked out project sources is removed from the agent, forcing a clean checkout the next time the project is built. Note: this doesn't necessarily mean thatcleanCheckoutEnforced()
will returntrue
immediately after this method is invoked (i.e. its return value may be different from that ofisCheckoutDirDirty()
).- Parameters:
checkoutDirDirty
- iftrue
, the checkout directory is marked as dirty, otherwise it is marked as clean.- Throws:
RecoverableStageFailure
- if aRemoteCallException
was thrown by eitherAgentLogListener
orAgentRevisionManager
.RunBuildException
- if either server-side or agent-side status can't be changed.- Since:
- 9.1
- See Also:
AgentRevisionManager.markCheckoutDirClean(AgentRunningBuild)
,AgentRevisionManager.markCheckoutDirDirty(AgentRunningBuild)
,isCheckoutDirDirty()
,cleanCheckoutEnforced()
-
clearCheckoutDirRevisions
void clearCheckoutDirRevisions() throws RunBuildException
Deletes information about checkout directory revisions preparing directory for clean checkout.
Since, we don't keep information about revisions on server this will result in clean checkout.- Throws:
RunBuildException
- Since:
- 2017.1
-
isCheckoutDirDirty
boolean isCheckoutDirDirty()
Returns the "dirty" status of the checkout directory.
- Returns:
- the "dirty" status of the checkout directory.
- Since:
- 9.1
- See Also:
setCheckoutDirDirty(boolean)
-
getBuildLogTail
@NotNull BuildLogTail getBuildLogTail()
- Returns:
- build log tail for this build
- Since:
- 9.1
-
setResolvedCheckoutMode
void setResolvedCheckoutMode(@NotNull AgentCheckoutMode resolvedCheckoutMode)
Set checkout method that will be used in this build.- Since:
- 10.0
- See Also:
AgentRunningBuild.getEffectiveCheckoutMode()
-
setDefaultCheckoutDirectory
void setDefaultCheckoutDirectory(@NotNull AgentCheckoutMode checkoutMode)
Set default checkout directory based on checkout mode that will be used in this build.- Since:
- 10.0
-
getParameterSpec
@Deprecated String getParameterSpec(@NotNull String name)
Deprecated.usegetParameterControlDescription(String)
instead- Parameters:
name
-- Returns:
-
getParameterControlDescription
@Nullable ControlDescription getParameterControlDescription(@NotNull String name)
Returns description object for the corresponding parameter if it is known on the agent.- Parameters:
name
- parameter name- Returns:
- control description object which is created from the parameter spec
- Since:
- 2023.05
-
getInterruptDetails
@Nullable BuildInterruptDetails getInterruptDetails()
- Returns:
- Detailed information about build interruption (if the build was interrupted)
- Since:
- 2019.1
-
setDetachedFromAgent
void setDetachedFromAgent(boolean detached)
Make the agent be detacheced/attached to some build. Detached indicates that the build tasks are finished on the agent but the build itself should continue until some external process finishes it- Parameters:
detached
- true if agent should be detached from its current build- Since:
- 2019.2
-
isDetachedFromAgent
boolean isDetachedFromAgent()
Return detached status of the agent.- Returns:
- true if the agent is detached from a build; false - otherwise
-
getUnresolvedServerParameters
Map<String,String> getUnresolvedServerParameters()
Return a map of all parameters which came from the TeamCity server- Returns:
- see above
- Since:
- 2020.1
-
cleanParameters
void cleanParameters()
-
getRunnersToExecute
@NotNull List<BuildRunnerSettings> getRunnersToExecute()
- Returns:
-
setBuildRunnerToExecute
void setBuildRunnerToExecute(int buildRunnerToExecute)
Sets the number of runner to execute a build step (used for purposes of Executor Mode)- Parameters:
buildRunnerToExecute
- number of runner to be a build step executor- Since:
- 2023.09
-
-