Class BaseRunningBuild

    • Field Detail

      • myStatusText

        protected volatile String myStatusText
      • myLastUpdateTimestamp

        protected volatile Date myLastUpdateTimestamp
    • Constructor Detail

    • Method Detail

      • createSettingsDigest

        protected void createSettingsDigest()
      • skipBuildChainBuilds

        public void skipBuildChainBuilds​(@NotNull
                                         List<String> externalIdsOrTags,
                                         @NotNull
                                         String cancelComment)
        Description copied from interface: RunningBuildEx
        This call looks for builds tagged with 'tags' in all build chains this running build belongs to, and cancels/removes such builds from the queue.
        Specified by:
        skipBuildChainBuilds in interface RunningBuildEx
        Parameters:
        externalIdsOrTags - array of tags for builds which should be skipped in the build chain. A tag could be either a build configuration external ID, or a tag specified via a special tag parameter on a build configuration.
        cancelComment - comment to use when canceling queued builds
      • isInterrupted

        public boolean isInterrupted()
        Description copied from interface: SRunningBuild
        When processing buildFinished event, returns true if build was finished unexpectedly (for instance, killed)
        Specified by:
        isInterrupted in interface SRunningBuild
        Returns:
        true or false
      • getCanceledInfo

        public CanceledInfo getCanceledInfo()
        Description copied from interface: Build
        Returns info related to interrupted build. If build is finished, not interrupted, the value is null.
        Specified by:
        getCanceledInfo in interface Build
        Returns:
        info about canceled reason and canceler if build was actually interrupted, null otherwise.
      • setCanceledInfo

        protected void setCanceledInfo​(CanceledInfo canceledInfo)
      • getBuildDescription

        public String getBuildDescription()
        Description copied from interface: SBuild
        Returns build description set to this build explicitly or null.
        Specified by:
        getBuildDescription in interface SBuild
        Returns:
        see above
      • setCustomStatusText

        public void setCustomStatusText​(@Nullable
                                        String text)
        Description copied from interface: RunningBuildEx
        Sets the custom build status text.
        Specified by:
        setCustomStatusText in interface RunningBuildEx
        Parameters:
        text - new build status text. Supports "{build.status.text}" placeholder to be substituted with the default text
      • setInterrupted

        public final void setInterrupted​(@NotNull
                                         RunningBuildState state,
                                         @Nullable
                                         User user,
                                         @Nullable
                                         String reason)
        Description copied from interface: SRunningBuild
        Mark this build as interrupted.
        Specified by:
        setInterrupted in interface SRunningBuild
        Parameters:
        state - running build state
        user - user who initiated interruption or null
        reason - reason why interruption initiated or null
      • stop

        public void stop​(@Nullable
                         User user,
                         @Nullable
                         String comment)
        Description copied from interface: SRunningBuild
        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.
        Specified by:
        stop in interface SRunningBuild
        Parameters:
        user - user who stopped build or null
        comment - comment for the action or null
      • logFinalMessages

        protected void logFinalMessages()
      • getHangingDependency

        @Nullable
        public RunningBuildEx getHangingDependency()
        Specified by:
        getHangingDependency in interface RunningBuildEx
        Returns:
        Traverses through running snapshot dependencies of this build and returns the first one which is probably hanging.
      • finish

        public boolean finish()
        Description copied from interface: RunningBuildEx
        The method completes the build finishing procedure and should not be called directly in the majority of cases. Instead SRunningBuild.finish(Date) method should be used to finish the build.
        Specified by:
        finish in interface RunningBuildEx
      • writeFinishProperties

        protected void writeFinishProperties()
      • doBuildFinish

        protected boolean doBuildFinish()
      • initCurrentStatisticValues

        protected void initCurrentStatisticValues()
      • updateBuildStatisticValues

        public void updateBuildStatisticValues()
        Description copied from interface: RunningBuildEx
        Loads statistic values reported for the build from database and sends events on every new loaded value
        Specified by:
        updateBuildStatisticValues in interface RunningBuildEx
      • updateBuildIfLastUpdateExpired

        public void updateBuildIfLastUpdateExpired​(int expirationTimeSeconds)
        Description copied from interface: RunningBuildEx
        Performs update of the build data but only if some time has passed since the last update.
        Specified by:
        updateBuildIfLastUpdateExpired in interface RunningBuildEx
        Parameters:
        expirationTimeSeconds - time threshold since the last update in seconds
      • getLastUpdateDelayMsecs

        public long getLastUpdateDelayMsecs()
      • getCompletedStages

        @NotNull
        public Map<String,​Long> getCompletedStages()
        Description copied from interface: RunningBuildEx
        Reports target build-type's stages (this build being instance of) that have been already completed by this particular build
        Specified by:
        getCompletedStages in interface RunningBuildEx
        Returns:
        mapping from stage-names to respective durations
      • loadCancelledInfoFromDB

        protected void loadCancelledInfoFromDB​(DBFunctions dbf)