Package jetbrains.buildServer.serverSide
Interface SRunningBuild
-
- All Superinterfaces:
Build
,BuildPromotionOwner
,ParametersSupport
,RunningBuild
,SBuild
- All Known Subinterfaces:
RunningBuildEx
- All Known Implementing Classes:
BaseRunningBuild
,CompositeRunningBuild
,MockBuild
,RunningBuildImpl
,RunningBuildWrapper
,SecuredCompositeRunningBuild
,SecuredRunningBuild
public interface SRunningBuild extends SBuild, RunningBuild
Running build interface, contains information specific for running build.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
addBuildMessage(BuildMessage1 message)
Deprecated.since 10.0 messages in build log should be logged viaBuildLog
, seeSBuild.getBuildLog()
method.void
addBuildMessages(List<BuildMessage1> messages)
Deprecated.since 10.0 messages in build log should be logged viaBuildLog
, seeSBuild.getBuildLog()
method.void
addRemoteArtifact(RemoteArtifact artifact)
Adds information about remote artifact to this buildvoid
finish(Date finishDate)
Finalizes all build related activities and finishes the build.SBuildAgent
getAgent()
Get build agent this running build is running on.String
getAgentAccessCode()
Returns access code which can be used by agent to access server resources by HTTP.int
getAgentId()
int
getCompletedPercent()
String
getCurrentPath()
Returns short description of current running step.Date
getLastBuildActivityTimestamp()
Integer
getQueuedAgentId()
Deprecated.AgentRestrictor
getQueuedAgentRestrictor()
Returns an agent restrictor this build was queued with (when build configuration was added to queue).long
getTimeSpentSinceLastBuildActivity()
Returns time in seconds spent since last build activity.boolean
isInterrupted()
When processing buildFinished event, returns true if build was finished unexpectedly (for instance, killed)boolean
isProbablyHanging()
Returns true if server thinks this build has hung.void
setBuildNumber(String newBuildNumber)
Set new value for this build build number instead of current one.void
setBuildStatus(Status status)
Deprecated.use jetbrains.buildServer.serverSide.SBuild#addBuildProblem to fail build and jetbrains.buildServer.serverSide.SBuild#muteBuildProblems to mark build as successfulvoid
setInterrupted(RunningBuildState state, User user, String reason)
Mark this build as interrupted.void
stop(User user, String comment)
Stops the build.-
Methods inherited from interface jetbrains.buildServer.Build
getAgentName, getBuildId, getBuildNumber, getBuildStatus, getBuildTypeExternalId, getBuildTypeId, getBuildTypeName, getCanceledInfo, getCompilationErrorMessages, getDuration, getFinishDate, getFullName, getLogMessages, getProjectExternalId, getProjectId, getStartDate, getStatusDescriptor, getTestMessages, isFinished, isPersonal
-
Methods inherited from interface jetbrains.buildServer.serverSide.BuildPromotionOwner
getBuildPromotion, getSequenceBuild
-
Methods inherited from interface jetbrains.buildServer.serverSide.ParametersSupport
getParametersProvider
-
Methods inherited from interface jetbrains.buildServer.RunningBuild
getDurationEstimate, getDurationOvertime, getElapsedTime, getEstimationForTimeLeft
-
Methods inherited from interface jetbrains.buildServer.serverSide.SBuild
addBuildProblem, addUserBuildProblem, convertToAgentTime, convertToServerTime, getArtifactDependencies, getArtifacts, getArtifactsDirectory, getBranch, getBuildComment, getBuildDescription, getBuildFeaturesOfType, getBuildLog, getBuildOwnParameters, getBuildStatistics, getBuildType, getChanges, getClientStartDate, getClientTimeZone, getCommitters, getContainingChanges, getCustomDataStorage, getDownloadedArtifacts, getFailureReasons, getFileContent, getFinishOnAgentDate, getFirstInternalError, getFirstInternalErrorMessage, getFullStatistics, getLabels, getOwner, getPreviousFinished, getProvidedArtifacts, getQueuedDate, getRawBuildNumber, getRecentlyFinishedBuild, getRelatedIssues, getRemoteArtifacts, getRemoteArtifactsByType, getRevisions, getServerStartDate, getShortStatistics, getStatisticValue, getStatisticValues, getTags, getTriggeredBy, getValueResolver, getVcsRootEntries, getWaitReasons, hasBuildProblemOfType, hasTests, isAgentLessBuild, isArtifactsExists, isCompositeBuild, isDetachedFromAgent, isHasInternalArtifactsOnly, isHasRelatedIssues, isInternalError, isOutdated, isOutOfChangesSequence, isPinned, isResponsibleNeeded, isStartedOnAgent, isUsedByOtherBuilds, muteBuildProblems, setBuildComment, setTags, setTags
-
-
-
-
Method Detail
-
getCurrentPath
String getCurrentPath()
Returns short description of current running step.- Returns:
- short description of current running step.
-
getAgent
@NotNull SBuildAgent getAgent()
Get build agent this running build is running on. May be unregistered or even dead agent, but never null.
-
getAgentId
int getAgentId()
- Returns:
- id of the agent where this build is running; returns -1 for agent less builds
- Since:
- 2017.2.3
-
getQueuedAgentId
@Deprecated @Nullable Integer getQueuedAgentId()
Deprecated.usegetQueuedAgentRestrictor()
. Returns id of an agent this build was queued on (when build configuration was added to queue). Returns null if build was not queued on a specific agent.- Returns:
- agent this build was queued on or null if build was not queued on a specific agent
-
getQueuedAgentRestrictor
@Nullable AgentRestrictor getQueuedAgentRestrictor()
Returns an agent restrictor this build was queued with (when build configuration was added to queue). Returns null if build was not queued on a specific agent / agent set.- Returns:
- see above
- Since:
- 7.0
-
isInterrupted
boolean isInterrupted()
When processing buildFinished event, returns true if build was finished unexpectedly (for instance, killed)- Returns:
- true or false
-
getCompletedPercent
int getCompletedPercent()
- Returns:
- completed percentage for the build according to build duration estimated time. or -1 if there is no estimate
-
addBuildMessages
void addBuildMessages(@NotNull List<BuildMessage1> messages)
Deprecated.since 10.0 messages in build log should be logged viaBuildLog
, seeSBuild.getBuildLog()
method.Adds new server messages to the build.- Parameters:
messages
- new build messages.
-
addBuildMessage
void addBuildMessage(@NotNull BuildMessage1 message)
Deprecated.since 10.0 messages in build log should be logged viaBuildLog
, seeSBuild.getBuildLog()
method.Adds new message from server to the build.
-
addRemoteArtifact
void addRemoteArtifact(@NotNull RemoteArtifact artifact)
Adds information about remote artifact to this build- Since:
- 2022.08
- See Also:
SBuild.getRemoteArtifacts()
-
setBuildNumber
void setBuildNumber(@NotNull String newBuildNumber)
Set new value for this build build number instead of current one. If newBuildNumber has pattern {build.number}, it is replaced with the current build number- Parameters:
newBuildNumber
- new value for this build build number
-
setBuildStatus
void setBuildStatus(Status status)
Deprecated.use jetbrains.buildServer.serverSide.SBuild#addBuildProblem to fail build and jetbrains.buildServer.serverSide.SBuild#muteBuildProblems to mark build as successfulSet current status of the running build. Useful before build finish to update build status.- Parameters:
status
- new status of the build
-
setInterrupted
void setInterrupted(@NotNull RunningBuildState state, @Nullable User user, @Nullable String reason)
Mark this build as interrupted.- Parameters:
state
- running build stateuser
- user who initiated interruption or nullreason
- reason why interruption initiated or null
-
getAgentAccessCode
String getAgentAccessCode()
Returns access code which can be used by agent to access server resources by HTTP.- Returns:
- access code
-
isProbablyHanging
boolean isProbablyHanging()
Returns true if server thinks this build has hung. The build is considered hung if its estimate is exceeded and there were no messages from this build for some time.- Returns:
- true if build is probably hanging
-
getLastBuildActivityTimestamp
Date getLastBuildActivityTimestamp()
- Returns:
- timestamp of last message received from a build.
-
getTimeSpentSinceLastBuildActivity
long getTimeSpentSinceLastBuildActivity()
Returns time in seconds spent since last build activity.- Returns:
- time in seconds
-
stop
void stop(@Nullable User user, @Nullable String comment)
Stops the build. If this is a user action, user who performs this action must be specified. If build is stopped without user it will be considered crashed and can be re-added into the queue.- Parameters:
user
- user who stopped build or nullcomment
- comment for the action or null
-
finish
void finish(@NotNull Date finishDate)
Finalizes all build related activities and finishes the build. Build must be finished on agent. Takes no effect for already finished or interrupted builds.- Parameters:
finishDate
- finish date- Since:
- 2021.1
-
-