Class CompositeRunningBuild
- java.lang.Object
-
- jetbrains.buildServer.serverSide.impl.BaseBuild
-
- jetbrains.buildServer.serverSide.impl.BaseRunningBuild
-
- jetbrains.buildServer.serverSide.impl.CompositeRunningBuild
-
- All Implemented Interfaces:
Build,RunningBuild,RunningBuildInfo,BuildEx,BuildPromotionOwner,ParametersSupport,RunningBuildEx,SBuild,SRunningBuild
- Direct Known Subclasses:
SecuredCompositeRunningBuild
public class CompositeRunningBuild extends BaseRunningBuild implements RunningBuildEx
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class jetbrains.buildServer.serverSide.impl.BaseRunningBuild
BaseRunningBuild.ArtifactsStats
-
-
Field Summary
Fields Modifier and Type Field Description static StringFAKE_SERVER_AGENTstatic StringKEY_ARCHIVE_INTROSPECTION_ENABLEDThe name of the build configuration parameter which allows to enable or disable archive introspection for the artifacts of composite builds.-
Fields inherited from class jetbrains.buildServer.serverSide.impl.BaseRunningBuild
myLastUpdateTimestamp, myStatusText, OLD_UNEXPECTED_FINISH
-
Fields inherited from class jetbrains.buildServer.serverSide.impl.BaseBuild
myBuildId, myContext, myStatsCallCounter, REMOTE_ARTIFACTS_PREFIX
-
Fields inherited from interface jetbrains.buildServer.serverSide.RunningBuildEx
DEPENDENCIES_SKIP_ENABLED
-
-
Constructor Summary
Constructors Constructor Description CompositeRunningBuild(BuildPromotionEx buildPromotion, String buildNumber, long buildCounter, String rawTriggeredBy, Date startDate, BuildContext context)Used for loading theCompositeRunningBuildfrom DBCompositeRunningBuild(BuildPromotionEx buildPromotion, String rawTriggeredBy, BuildContext context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddBuildMessage(BuildMessage1 message)Adds new message from server to the build.voidaddBuildMessages(List<BuildMessage1> messages)Adds new server messages to the build.voidbuildPatch(OutputStream stream, FullCheckoutFlag fullCheckoutFlag, boolean personalChanges, AgentCheckoutDirRevisionInfo workDirState)voidbuildPersonalPatch(OutputStream stream, long personalChangeId, AgentCheckoutDirRevisionInfo workDirState)voidcloseBuildLog()Closes the build log's root block, flushes messages and closes the build logAgentBuildcreateAgentBuild()Creates structure containing all of the parameters which should be sent to an agentvoiddetachedFromAgent()Should be called when the build has been detached from the agent and agent can start some other buildprotected booleandoBuildFinish()booleanfinish()The method completes the build finishing procedure and should not be called directly in the majority of cases.voidfinish(Date finishDate)Finalizes all build related activities and finishes the build.voidfinishedOnOtherNode()voidfinishImmediately(Date finishDate, boolean failed)For tests only!BuildAgentExgetAgent()Get build agent this running build is running on.StringgetAgentAccessCode()Returns access code which can be used by agent to access server resources by HTTP.intgetAgentId()StringgetAgentName()Returns agent name where build is running or happened to run if finished.ArtifactsUploadLimitgetArtifactsLimit()BuildConfigurationInfogetBuildConfiguration()longgetBuildCounter()BuildLogExgetBuildLog()Returns build log.BuildLogExgetBuildLogIfInitialized()StringgetBuildNumber()Returns build number in the user defined format (unresolved parameters in build number will be replaced with '???').BuildPromotionInfogetBuildPromotionInfo()ShortStatisticsgetCachedShortStatistics(boolean calculateIfAbsent)Return cached short statistics for this build.intgetCompletedPercent()Map<String,Long>getCompletedStages()Reports target build-type's stages (this build being instance of) that have been already completed by this particular buildStringgetCurrentPath()Returns short description of current running step.BuildDependencyGraphgetDependencyGraph()LonggetDetachFromAgentReceivedTimestamp()longgetDurationEstimate()Returns server estimation for this build duration in seconds.longgetDurationOvertime()Returns how much in seconds this build duration exceeded estimated duration.longgetElapsedTime()Returns elapsed time for this build.longgetEstimationForTimeLeft()Returns server estimation for this build remaining time.DategetFinishDate()Returns finish timestamp for the build (server time) ornullif it hasn't been finished yet.DategetFinishOnAgentDate()Returns timestamp when the build finished on agent (server time) ornullif it is still running on agent.DategetLastBuildActivityTimestamp()StringgetProgressText()StringgetProjectExternalId()Returns external id of the project this build belongs to.StringgetProjectId()Returns internal id of the project this build belongs to.IntegergetQueuedAgentId()SAgentRestrictorgetQueuedAgentRestrictor()Returns an agent restrictor this build was queued with (when build configuration was added to queue).StringgetRawBuildNumber()Returns raw build number (i.e.DategetServerStartDate()Returns the timestamp when the build was removed from the queue.ShortStatisticsgetShortStatistics()Calculates short statistics for this build.DategetStartDate()Returns timestamp when the build start command has been sent to an agent (server-time) or remove from queue time if start command has not been sentStatusDescriptorgetStatusDescriptor()Returns status descriptor of the buildTestRunMutergetTestRunMuter()Returns a special service that allows to mute test run if neccessary.longgetTimeSpentSinceLastBuildActivity()Returns time in seconds spent since last build activity.UserDataStoragegetUserDataStorage()Use this object to associate some data with the current instance.booleanisCompositeBuild()Returns true if this build is a composite build.booleanisDetachedFromAgent()Returns true if this build was detached from agent at some point.booleanisFinished()booleanisFinishing()booleanisFinishReceived()booleanisProbablyHanging()Returns true if server thinks this build has hung.booleanisStarted()booleanisStartedOnAgent()Returns true if this build was started on agent.booleanisStarting()Returns true if the build is trying to start on an agent and runBuild() command has not finished yetbooleanisStopping()voidmarkAsFinished(Date finishDate, boolean failed)voidmarkAsFinishedUnexpectedly(String reason)booleanmarkStopping()voidnotifyOnDependencyUpdate()booleanoccupiesAgent()voidprepareArtifactDependencies()Resolves artifact dependencies by replacing "latest" rules with actual build ids.voidpublishArtifact(String path, byte[] content)Adds artifact to the build by the specified pathvoidpublishArtifact(String path, File srcFile)Adds artifact to the build by the specified pathvoidpublishArtifact(String path, File srcFile, PublishArtifactProgressListener progressListener)Adds artifact to the build from the specified file allowing to trace progressvoidpublishArtifact(String path, InputStream is)Adds artifact to the build by the specified pathvoidpublishArtifact(String path, InputStream is, PublishArtifactProgressListener progressListener)Adds artifact to the build from the specified stream allowing to trace progressvoidresetAgentCache()Resets internal cache of agent instancevoidresetShortStatistics()booleanrunUnlessFinished(Runnable action)Executes specified runnable if build is not finished.voidserverShutdown()voidserverStartup()voidsetBuildNumber(String newBuildNumber)Set new value for this build build number instead of current one.voidsetBuildStatus(Status status)Set current status of the running build.voidsetStartTimes(Date agentStartTime, Date serverStartTime, TimeZone agentTimeZone)Sets timestamps when command to run build was sent to an agent.voidstart(boolean async)Must be invoked only once when build starts.voidstop(RunningBuildState interruptedState, User user, String comment, boolean reAdd2Queue)voidstopDependentBuilds(User user, String comment, boolean skipAlreadyInterrupted)voidstopNoInterrupt()Stops build on server and on agent without making it interruptedStringtoString()voidupdateBuild()booleanupdateBuildInfo()Loads build interruption and build finish timestamps from database into the build.-
Methods inherited from class jetbrains.buildServer.serverSide.impl.BaseRunningBuild
addRemoteArtifact, createSettingsDigest, getArtifactsStats, getBuildDescription, getBuildPromotion, getCanceledInfo, getHangingDependency, getLastUpdateDelayMsecs, getRunningState, getStatisticValuesCollection, initCurrentStatisticValues, isInterrupted, loadCancelledInfoFromDB, logFinalMessages, notifyOnBuildProblemsChanged, resolveArtifactDependencies, setCanceledInfo, setCustomStatusText, setInterrupted, skipBuildChainBuilds, startBuildFailureChecker, stop, stopBuildFailureChecker, updateBuildIfLastUpdateExpired, updateBuildStatisticValues, writeFinishProperties, writeSettingsDigestFile
-
Methods inherited from class jetbrains.buildServer.serverSide.impl.BaseBuild
addBuildProblem, addUserBuildProblem, buildProblemsChanged, convertToAgentTime, convertToServerTime, createShortStatistics, deleteBuildProblem, doGetBuildFinishParameters, doGetBuildStartParameters, getArtifactDependencies, getArtifacts, getArtifactsDirectory, getAuditLogFactory, getAuditLogProvider, getBranch, getBuildComment, getBuildContext, getBuildFeaturesOfType, getBuildFinishParameters, getBuildId, getBuildNumberParameters, getBuildNumberWithoutRefs, getBuildOwnParameters, getBuildProblems, getBuildStartParameters, getBuildStatistics, getBuildStatus, getBuildType, getBuildTypeExternalId, getBuildTypeId, getBuildTypeName, getChanges, getClientStartDate, getClientTimeZone, getCommitters, getCompilationErrorMessages, getContainingChanges, getCustomDataStorage, getCustomDataStorageIdsByPrefix, getDownloadedArtifacts, getDuration, getDurationOnAgent, getFailureReasons, getFileContent, getFirstInternalError, getFirstInternalErrorMessage, getFullName, getFullStatistics, getId, getLabels, getLogMessages, getOwner, getParametersProvider, getPreviousFinished, getProvidedArtifacts, getQueuedDate, getRecentlyFinishedBuild, getRelatedIssues, getRemoteArtifacts, getRemoteArtifactsByType, getRevisions, getSequenceBuild, getSettingsDigestFile, getSettingsDigestFromFile, getStatisticValue, getStatisticValues, getStatus, getTags, getTemporaryCustomDataStorage, getTestMessages, getTriggeredBy, getValueResolver, getValueResolver, getValueResolver, getVariablesProvider, getVcsRootEntries, getWaitReasons, hasBuildFinishParameters, hasBuildProblemOfType, hasTests, initMetrics, isAgentLessBuild, isArtifactsExists, isHasInternalArtifactsOnly, isHasRelatedIssues, isInternalError, isOutdated, isOutOfChangesSequence, isPersonal, isPersonalPatchAvailable, isPinned, isResponsibleNeeded, isTimedOut, isUsedByOtherBuilds, muteBuildProblems, muteBuildProblems, now, nowDate, preloadFailedTests, publishStatisticValue, resetBuildFinalParameters, setBuildComment, setBuildStartTimes, setTags, setTags, updateExternalArtifactsInfoOnAccess
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jetbrains.buildServer.Build
getBuildId, getBuildStatus, getBuildTypeExternalId, getBuildTypeId, getBuildTypeName, getCanceledInfo, getCompilationErrorMessages, getDuration, getFullName, getLogMessages, getTestMessages, isPersonal
-
Methods inherited from interface jetbrains.buildServer.serverSide.BuildPromotionOwner
getSequenceBuild
-
Methods inherited from interface jetbrains.buildServer.serverSide.ParametersSupport
getParametersProvider
-
Methods inherited from interface jetbrains.buildServer.serverSide.RunningBuildEx
getBuildPromotion, getHangingDependency, getRunnersState, getStatisticValuesCollection, getTemporaryCustomDataStorage, setCustomStatusText, skipBuildChainBuilds, startBuildFailureChecker, stopBuildFailureChecker, updateBuildIfLastUpdateExpired, updateBuildStatisticValues, updateExternalArtifactsInfoOnAccess, writeSettingsDigestFile
-
Methods inherited from interface jetbrains.buildServer.serverSide.SBuild
addBuildProblem, addUserBuildProblem, convertToAgentTime, convertToServerTime, getArtifactDependencies, getArtifacts, getArtifactsDirectory, getBranch, getBuildComment, getBuildDescription, getBuildFeaturesOfType, getBuildOwnParameters, getBuildStatistics, getBuildType, getChanges, getClientStartDate, getClientTimeZone, getCommitters, getContainingChanges, getCustomDataStorage, getDownloadedArtifacts, getFailureReasons, getFileContent, getFirstInternalError, getFirstInternalErrorMessage, getFullStatistics, getLabels, getOwner, getPreviousFinished, getProvidedArtifacts, getQueuedDate, getRecentlyFinishedBuild, getRelatedIssues, getRemoteArtifacts, getRemoteArtifactsByType, getRevisions, getStatisticValue, getStatisticValues, getTags, getTriggeredBy, getValueResolver, getVcsRootEntries, getWaitReasons, hasBuildProblemOfType, hasTests, isAgentLessBuild, isArtifactsExists, isHasInternalArtifactsOnly, isHasRelatedIssues, isInternalError, isOutdated, isOutOfChangesSequence, isPinned, isResponsibleNeeded, isUsedByOtherBuilds, muteBuildProblems, setBuildComment, setTags, setTags
-
Methods inherited from interface jetbrains.buildServer.serverSide.SRunningBuild
addRemoteArtifact, isInterrupted, setInterrupted, stop
-
-
-
-
Field Detail
-
KEY_ARCHIVE_INTROSPECTION_ENABLED
@NonNls @NotNull public static final String KEY_ARCHIVE_INTROSPECTION_ENABLED
The name of the build configuration parameter which allows to enable or disable archive introspection for the artifacts of composite builds. The default is off (archive introspection disabled).
- See Also:
- Constant Field Values
-
FAKE_SERVER_AGENT
public static final String FAKE_SERVER_AGENT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CompositeRunningBuild
public CompositeRunningBuild(@NotNull BuildPromotionEx buildPromotion, @Nullable String rawTriggeredBy, @NotNull BuildContext context)
-
CompositeRunningBuild
public CompositeRunningBuild(@NotNull BuildPromotionEx buildPromotion, @NotNull String buildNumber, long buildCounter, @Nullable String rawTriggeredBy, @NotNull Date startDate, @NotNull BuildContext context)Used for loading theCompositeRunningBuildfrom DB
-
-
Method Detail
-
isStarted
public boolean isStarted()
-
isStarting
public boolean isStarting()
Description copied from interface:RunningBuildExReturns true if the build is trying to start on an agent and runBuild() command has not finished yet- Specified by:
isStartingin interfaceRunningBuildEx- Returns:
-
getCurrentPath
public String getCurrentPath()
Description copied from interface:SRunningBuildReturns short description of current running step.- Specified by:
getCurrentPathin interfaceSRunningBuild- Returns:
- short description of current running step.
-
getBuildConfiguration
@Nullable public BuildConfigurationInfo getBuildConfiguration()
- Specified by:
getBuildConfigurationin interfaceRunningBuildInfo- Returns:
- the corresponding build configuration or null if the configuration has been concurrently deleted
-
getAgent
@NotNull public BuildAgentEx getAgent()
Description copied from interface:SRunningBuildGet build agent this running build is running on. May be unregistered or even dead agent, but never null.- Specified by:
getAgentin interfaceRunningBuildInfo- Specified by:
getAgentin interfaceSBuild- Specified by:
getAgentin interfaceSRunningBuild- Specified by:
getAgentin classBaseRunningBuild- Returns:
- agent where this build executed.
-
getAgentId
public int getAgentId()
- Specified by:
getAgentIdin interfaceSRunningBuild- Returns:
- id of the agent where this build is running; returns -1 for agent less builds
-
buildPatch
public void buildPatch(OutputStream stream, @NotNull FullCheckoutFlag fullCheckoutFlag, boolean personalChanges, @NotNull AgentCheckoutDirRevisionInfo workDirState)
- Specified by:
buildPatchin interfaceRunningBuildEx
-
buildPersonalPatch
public void buildPersonalPatch(OutputStream stream, long personalChangeId, @NotNull AgentCheckoutDirRevisionInfo workDirState)
- Specified by:
buildPersonalPatchin interfaceRunningBuildEx
-
setStartTimes
public void setStartTimes(@NotNull Date agentStartTime, @NotNull Date serverStartTime, @NotNull TimeZone agentTimeZone)Description copied from interface:RunningBuildExSets timestamps when command to run build was sent to an agent.- Specified by:
setStartTimesin interfaceRunningBuildEx- Parameters:
agentStartTime- agent timestampserverStartTime- server timestamp
-
updateBuild
public void updateBuild()
- Specified by:
updateBuildin interfaceRunningBuildEx
-
updateBuildInfo
public boolean updateBuildInfo()
Description copied from interface:RunningBuildExLoads build interruption and build finish timestamps from database into the build. Returns true if running build exists in DB and false otherwise.- Specified by:
updateBuildInfoin interfaceRunningBuildEx
-
getQueuedAgentId
public Integer getQueuedAgentId()
- Specified by:
getQueuedAgentIdin interfaceSRunningBuild- Returns:
- agent this build was queued on or null if build was not queued on a specific agent
-
getQueuedAgentRestrictor
@Nullable public SAgentRestrictor getQueuedAgentRestrictor()
Description copied from interface:RunningBuildExReturns 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.- Specified by:
getQueuedAgentRestrictorin interfaceRunningBuildEx- Specified by:
getQueuedAgentRestrictorin interfaceSRunningBuild- Returns:
- see above
-
getUserDataStorage
@NotNull public UserDataStorage getUserDataStorage()
Description copied from interface:RunningBuildExUse this object to associate some data with the current instance. Stored data is not persisted and is not copied to another instance of the given object.- Specified by:
getUserDataStoragein interfaceRunningBuildEx- Returns:
- user data holder
-
getCompletedStages
@NotNull public Map<String,Long> getCompletedStages()
Description copied from interface:RunningBuildExReports target build-type's stages (this build being instance of) that have been already completed by this particular build- Specified by:
getCompletedStagesin interfaceRunningBuildEx- Overrides:
getCompletedStagesin classBaseRunningBuild- Returns:
- mapping from stage-names to respective durations
-
isFinishReceived
public boolean isFinishReceived()
- Specified by:
isFinishReceivedin interfaceRunningBuildEx- Returns:
- true if build finished was received by the server.
-
markAsFinished
public void markAsFinished(@NotNull Date finishDate, boolean failed)- Specified by:
markAsFinishedin interfaceRunningBuildEx
-
markAsFinishedUnexpectedly
public void markAsFinishedUnexpectedly(@NotNull String reason)- Specified by:
markAsFinishedUnexpectedlyin interfaceRunningBuildEx
-
publishArtifact
@Contract("_, _ -> fail") public void publishArtifact(@NotNull String path, @NotNull byte[] content)Adds artifact to the build by the specified pathComposite builds don't need any external triggers to publish their artifacts, so this method always throws an
UnsupportedOperationException.- Specified by:
publishArtifactin interfaceRunningBuildEx- Parameters:
path- path where to store artifactcontent- artifact content- Throws:
UnsupportedOperationException- always.- See Also:
RunningBuildEx.publishArtifact(String, byte[])
-
publishArtifact
@Contract("_, _ -> fail") public void publishArtifact(@NotNull String path, @NotNull File srcFile)Adds artifact to the build by the specified pathComposite builds don't need any external triggers to publish their artifacts, so this method always throws an
UnsupportedOperationException.- Specified by:
publishArtifactin interfaceRunningBuildEx- Parameters:
path- path where to store artifactsrcFile- file containing artifact content; note that after the publishing srcFile can be removed- Throws:
UnsupportedOperationException- always.- See Also:
RunningBuildEx.publishArtifact(String, File)
-
publishArtifact
@Contract("_, _ -> fail") public void publishArtifact(@NotNull String path, @NotNull InputStream is)Adds artifact to the build by the specified pathComposite builds don't need any external triggers to publish their artifacts, so this method always throws an
UnsupportedOperationException.- Specified by:
publishArtifactin interfaceRunningBuildEx- Parameters:
path- path where to store artifact- Throws:
UnsupportedOperationException- always.- See Also:
RunningBuildEx.publishArtifact(String, InputStream)
-
getCompletedPercent
public int getCompletedPercent()
- Specified by:
getCompletedPercentin interfaceSRunningBuild- Returns:
- completed percentage for the build according to build duration estimated time. or -1 if there is no estimate
-
addBuildMessages
public void addBuildMessages(@NotNull List<BuildMessage1> messages)Description copied from interface:SRunningBuildAdds new server messages to the build.- Specified by:
addBuildMessagesin interfaceSRunningBuild- Parameters:
messages- new build messages.
-
addBuildMessage
public void addBuildMessage(@NotNull BuildMessage1 message)Description copied from interface:RunningBuildExAdds new message from server to the build.- Specified by:
addBuildMessagein interfaceRunningBuildEx- Specified by:
addBuildMessagein interfaceSRunningBuild
-
start
public void start(boolean async)
Description copied from interface:RunningBuildExMust be invoked only once when build starts.- Specified by:
startin interfaceRunningBuildEx
-
isStartedOnAgent
public boolean isStartedOnAgent()
Description copied from interface:SBuildReturns true if this build was started on agent.- Specified by:
isStartedOnAgentin interfaceSBuild- Overrides:
isStartedOnAgentin classBaseBuild- Returns:
- see above
-
doBuildFinish
protected boolean doBuildFinish()
- Overrides:
doBuildFinishin classBaseRunningBuild
-
isFinishing
public boolean isFinishing()
-
finishImmediately
public void finishImmediately(@NotNull Date finishDate, boolean failed)Description copied from interface:RunningBuildExFor tests only!- Specified by:
finishImmediatelyin interfaceRunningBuildEx
-
finish
public boolean finish()
Description copied from interface:RunningBuildExThe method completes the build finishing procedure and should not be called directly in the majority of cases. InsteadSRunningBuild.finish(Date)method should be used to finish the build.- Specified by:
finishin interfaceRunningBuildEx- Overrides:
finishin classBaseRunningBuild
-
finishedOnOtherNode
public void finishedOnOtherNode()
- Specified by:
finishedOnOtherNodein interfaceRunningBuildEx- Overrides:
finishedOnOtherNodein classBaseRunningBuild
-
runUnlessFinished
public boolean runUnlessFinished(@NotNull Runnable action)Description copied from interface:RunningBuildExExecutes specified runnable if build is not finished. Build won't finish until runnable completes.- Specified by:
runUnlessFinishedin interfaceRunningBuildEx- Parameters:
action- runnable- Returns:
- true if runnable was executed
-
publishArtifact
public void publishArtifact(@NotNull String path, @NotNull InputStream is, @Nullable PublishArtifactProgressListener progressListener)Description copied from interface:RunningBuildExAdds artifact to the build from the specified stream allowing to trace progress- Specified by:
publishArtifactin interfaceRunningBuildEx- Parameters:
path- path where to store artifactprogressListener- PublishArtifactProgressListener to track progress
-
publishArtifact
public void publishArtifact(@NotNull String path, @NotNull File srcFile, @Nullable PublishArtifactProgressListener progressListener)Description copied from interface:RunningBuildExAdds artifact to the build from the specified file allowing to trace progress- Specified by:
publishArtifactin interfaceRunningBuildEx- Parameters:
path- path where to store artifactsrcFile- file containing artifact content; note that after the publishing srcFile can be removedprogressListener- PublishArtifactProgressListener to track progress
-
createAgentBuild
@NotNull public AgentBuild createAgentBuild()
Description copied from interface:RunningBuildExCreates structure containing all of the parameters which should be sent to an agent- Specified by:
createAgentBuildin interfaceRunningBuildEx- Returns:
-
getTestRunMuter
public TestRunMuter getTestRunMuter()
Description copied from interface:RunningBuildExReturns a special service that allows to mute test run if neccessary.- Specified by:
getTestRunMuterin interfaceRunningBuildEx- Returns:
- an instance of the test run muter.
-
setBuildNumber
public void setBuildNumber(@NotNull String newBuildNumber)Description copied from interface:SRunningBuildSet 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- Specified by:
setBuildNumberin interfaceSRunningBuild- Parameters:
newBuildNumber- new value for this build build number
-
setBuildStatus
public void setBuildStatus(Status status)
Description copied from interface:SRunningBuildSet current status of the running build. Useful before build finish to update build status.- Specified by:
setBuildStatusin interfaceSRunningBuild- Parameters:
status- new status of the build
-
getAgentAccessCode
public String getAgentAccessCode()
Description copied from interface:SRunningBuildReturns access code which can be used by agent to access server resources by HTTP.- Specified by:
getAgentAccessCodein interfaceSRunningBuild- Returns:
- access code
-
isProbablyHanging
public boolean isProbablyHanging()
Description copied from interface:SRunningBuildReturns 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.- Specified by:
isProbablyHangingin interfaceSRunningBuild- Returns:
- true if build is probably hanging
-
getLastBuildActivityTimestamp
public Date getLastBuildActivityTimestamp()
- Specified by:
getLastBuildActivityTimestampin interfaceSRunningBuild- Returns:
- timestamp of last message received from a build.
-
getTimeSpentSinceLastBuildActivity
public long getTimeSpentSinceLastBuildActivity()
Description copied from interface:SRunningBuildReturns time in seconds spent since last build activity.- Specified by:
getTimeSpentSinceLastBuildActivityin interfaceSRunningBuild- Returns:
- time in seconds
-
stop
public void stop(@NotNull RunningBuildState interruptedState, @Nullable User user, @NotNull String comment, boolean reAdd2Queue)- Specified by:
stopin interfaceRunningBuildEx- Parameters:
interruptedState- how to interrupt the build, should have interrupted statususer- optional user who stops the buildcomment- comment for build interruptionreAdd2Queue- if true, the build will be re-added to queue with the same build promotion (to the end of the queue)
-
finish
public void finish(@NotNull Date finishDate)Description copied from interface:SRunningBuildFinalizes all build related activities and finishes the build. Build must be finished on agent. Takes no effect for already finished or interrupted builds.- Specified by:
finishin interfaceSRunningBuild- Parameters:
finishDate- finish date
-
stopNoInterrupt
public void stopNoInterrupt()
Stops build on server and on agent without making it interrupted- Specified by:
stopNoInterruptin interfaceRunningBuildEx- See Also:
RunningBuildEx.stopNoInterrupt()
-
stopDependentBuilds
public void stopDependentBuilds(@Nullable User user, @NotNull String comment, boolean skipAlreadyInterrupted)
-
getEstimationForTimeLeft
public long getEstimationForTimeLeft()
Description copied from interface:RunningBuildReturns server estimation for this build remaining time.- Specified by:
getEstimationForTimeLeftin interfaceRunningBuild- Specified by:
getEstimationForTimeLeftin interfaceRunningBuildInfo- Returns:
- estimation for time left to finish the build in seconds or -1 if estimate is not available.
-
getBuildPromotionInfo
@NotNull public BuildPromotionInfo getBuildPromotionInfo()
- Specified by:
getBuildPromotionInfoin interfaceRunningBuildInfo- Returns:
- Returns build promotion, associated with this running build
-
occupiesAgent
public boolean occupiesAgent()
- Specified by:
occupiesAgentin interfaceRunningBuildInfo- Returns:
- true if the build executes on the agent.
-
getDurationEstimate
public long getDurationEstimate()
Description copied from interface:RunningBuildReturns server estimation for this build duration in seconds.- Specified by:
getDurationEstimatein interfaceRunningBuild- Returns:
- build duration estimation in seconds or -1 if estimate is not available.
-
getDurationOvertime
public long getDurationOvertime()
Description copied from interface:RunningBuildReturns how much in seconds this build duration exceeded estimated duration.- Specified by:
getDurationOvertimein interfaceRunningBuild- Returns:
- how much in seconds this build duration exceeded estimated duration or -1 if estimate is not available.
-
getElapsedTime
public long getElapsedTime()
Description copied from interface:RunningBuildReturns elapsed time for this build.- Specified by:
getElapsedTimein interfaceRunningBuild- Returns:
- elapsed time for this build in seconds.
-
getBuildLog
@NotNull public BuildLogEx getBuildLog()
Description copied from interface:SBuildReturns build log.- Specified by:
getBuildLogin interfaceBuildEx- Specified by:
getBuildLogin interfaceRunningBuildEx- Specified by:
getBuildLogin interfaceSBuild- Returns:
- build log.
-
getBuildLogIfInitialized
@Nullable public BuildLogEx getBuildLogIfInitialized()
- Specified by:
getBuildLogIfInitializedin interfaceRunningBuildEx
-
getCachedShortStatistics
@Nullable public ShortStatistics getCachedShortStatistics(boolean calculateIfAbsent)
Description copied from interface:BuildExReturn cached short statistics for this build.- Specified by:
getCachedShortStatisticsin interfaceBuildEx- Parameters:
calculateIfAbsent- if true, then statistics is calculated if it is not cached yet, if false and there is no statistics in cache, then null is returned- Returns:
- see above
-
getServerStartDate
@NotNull public Date getServerStartDate()
Description copied from interface:SBuildReturns the timestamp when the build was removed from the queue.- Specified by:
getServerStartDatein interfaceSBuild- Overrides:
getServerStartDatein classBaseBuild- Returns:
- the timestamp when the build was removed from the queue.
-
getRawBuildNumber
public String getRawBuildNumber()
Description copied from interface:SBuildReturns raw build number (i.e. build number with unresolved parameters if they exist) in contradistinction toBuild.getBuildNumber()method which will return build number with all unresolved parameters replaced with ???.- Specified by:
getRawBuildNumberin interfaceSBuild- Specified by:
getRawBuildNumberin classBaseBuild- Returns:
- raw build number which can contain unresolved parameters
-
getBuildCounter
public long getBuildCounter()
- Specified by:
getBuildCounterin interfaceRunningBuildEx- Specified by:
getBuildCounterin classBaseBuild- Returns:
- value of build counter when this build started
-
getProgressText
@NotNull public String getProgressText()
- Specified by:
getProgressTextin interfaceRunningBuildEx- Returns:
- current progress text calculated for the build; this text is used in build status line
-
getArtifactsLimit
@NotNull public ArtifactsUploadLimit getArtifactsLimit()
- Specified by:
getArtifactsLimitin interfaceRunningBuildEx
-
resetAgentCache
public void resetAgentCache()
Description copied from interface:RunningBuildExResets internal cache of agent instance- Specified by:
resetAgentCachein interfaceRunningBuildEx
-
serverStartup
public void serverStartup()
- Specified by:
serverStartupin interfaceRunningBuildEx
-
serverShutdown
public void serverShutdown()
- Specified by:
serverShutdownin interfaceRunningBuildEx
-
isCompositeBuild
public boolean isCompositeBuild()
Description copied from interface:SBuildReturns true if this build is a composite build.- Specified by:
isCompositeBuildin interfaceSBuild- Returns:
- see above
-
closeBuildLog
public void closeBuildLog()
Description copied from interface:RunningBuildExCloses the build log's root block, flushes messages and closes the build log- Specified by:
closeBuildLogin interfaceRunningBuildEx
-
detachedFromAgent
public void detachedFromAgent()
Description copied from interface:RunningBuildExShould be called when the build has been detached from the agent and agent can start some other build- Specified by:
detachedFromAgentin interfaceRunningBuildEx
-
isDetachedFromAgent
public boolean isDetachedFromAgent()
Description copied from interface:SBuildReturns true if this build was detached from agent at some point.- Specified by:
isDetachedFromAgentin interfaceSBuild- Overrides:
isDetachedFromAgentin classBaseBuild- Returns:
- see above
-
getDetachFromAgentReceivedTimestamp
@Nullable public Long getDetachFromAgentReceivedTimestamp()
- Specified by:
getDetachFromAgentReceivedTimestampin interfaceBuildEx- Specified by:
getDetachFromAgentReceivedTimestampin interfaceRunningBuildEx- Overrides:
getDetachFromAgentReceivedTimestampin classBaseBuild- Returns:
- timestamp when this build was attempted to detach from agent
-
prepareArtifactDependencies
public void prepareArtifactDependencies()
Description copied from interface:RunningBuildExResolves artifact dependencies by replacing "latest" rules with actual build ids.- Specified by:
prepareArtifactDependenciesin interfaceRunningBuildEx
-
getStartDate
@NotNull public Date getStartDate()
Description copied from interface:BuildReturns timestamp when the build start command has been sent to an agent (server-time) or remove from queue time if start command has not been sent- Specified by:
getStartDatein interfaceBuild- Overrides:
getStartDatein classBaseBuild- Returns:
- see above
-
getAgentName
public String getAgentName()
Description copied from interface:BuildReturns agent name where build is running or happened to run if finished.- Specified by:
getAgentNamein interfaceBuild- Returns:
- Agent name where build has been started on
-
getStatusDescriptor
public StatusDescriptor getStatusDescriptor()
Description copied from interface:BuildReturns status descriptor of the build- Specified by:
getStatusDescriptorin interfaceBuild- Returns:
- Descriptor of the current status of the build
-
getShortStatistics
@NotNull public ShortStatistics getShortStatistics()
Description copied from interface:SBuildCalculates short statistics for this build. Short statistics provides "isNew" details for failed tests only. If you need information about passed, ignored tests and compilation errors useSBuild.getBuildStatistics(jetbrains.buildServer.serverSide.BuildStatisticsOptions)method.- Specified by:
getShortStatisticsin interfaceSBuild- Overrides:
getShortStatisticsin classBaseBuild- Returns:
- short statistics for this build.
-
getProjectId
@Nullable public String getProjectId()
Description copied from interface:BuildReturns internal id of the project this build belongs to. Same as getBuildType().getProjectId().- Specified by:
getProjectIdin interfaceBuild- Returns:
- internal id of the project this build belongs to. Same as getBuildType().getProjectId().
-
getProjectExternalId
@Nullable public String getProjectExternalId()
Description copied from interface:BuildReturns external id of the project this build belongs to. Same as getBuildType().getProjectId().- Specified by:
getProjectExternalIdin interfaceBuild- Returns:
- external id of the project this build belongs to. Same as getBuildType().getProjectId().
-
isFinished
public boolean isFinished()
- Specified by:
isFinishedin interfaceBuild- Returns:
- true if the build was finished and was saved to the history
-
getBuildNumber
@NotNull public String getBuildNumber()
Description copied from interface:BuildReturns build number in the user defined format (unresolved parameters in build number will be replaced with '???').- Specified by:
getBuildNumberin interfaceBuild- Returns:
- presentable build number
-
getFinishDate
@Nullable public Date getFinishDate()
Description copied from interface:BuildReturns finish timestamp for the build (server time) ornullif it hasn't been finished yet.- Specified by:
getFinishDatein interfaceBuild- Returns:
- Date/time when the build has been finished,
nullif still running.
-
getFinishOnAgentDate
@Nullable public Date getFinishOnAgentDate()
Description copied from interface:SBuildReturns timestamp when the build finished on agent (server time) ornullif it is still running on agent.- Specified by:
getFinishOnAgentDatein interfaceSBuild- Overrides:
getFinishOnAgentDatein classBaseBuild- Returns:
- see above
-
getDependencyGraph
@NotNull public BuildDependencyGraph getDependencyGraph()
- Overrides:
getDependencyGraphin classBaseRunningBuild
-
isStopping
public boolean isStopping()
-
markStopping
public boolean markStopping()
-
notifyOnDependencyUpdate
public void notifyOnDependencyUpdate()
-
resetShortStatistics
public void resetShortStatistics()
-
-