Interface BuildCleanupContext

    • Method Detail

      • getCleanupLevel

        @NotNull
        CleanupLevel getCleanupLevel()
        Returns:
        current cleanup level
      • getCleanupPolicyForBuild

        @NotNull
        @Deprecated
        CleanupPolicy getCleanupPolicyForBuild​(long buildId)
        Deprecated.
        since 2019.2: always returns the cleanup policy with "do not clean anything" artifacts pattern.
        This method is intended for TeamCity internal usage only and can be changed, removed or throw an exception at any time!
        Always returns the cleanup policy with "do not clean anything" artifacts pattern.
        Parameters:
        buildId - id of the build
        Since:
        2017.1.1
      • getBuilds

        @NotNull
        java.util.List<SFinishedBuild> getBuilds()
        Returns list of builds to be cleaned on given cleanup level if such builds still exist.
      • getBuildIds

        @NotNull
        default java.util.List<java.lang.Long> getBuildIds()
        Returns ids of builds to be cleaned on given cleanup level.
      • onBuildCleanupError

        void onBuildCleanupError​(@NotNull
                                 BuildsCleanupExtension cleanupExtension,
                                 @NotNull
                                 SBuild build,
                                 @NotNull
                                 java.lang.String errorMessage)
        Informs the core clean-up process about an error happened in a clean-up extension.
        Note: if there are a lot of such calls, try to keep the same errorMessage when possible: it will allow to provide the resulting health report in a more compact format.
        Parameters:
        cleanupExtension - the affected clean-up extension
        build - the affected build
        errorMessage - the error description
        Since:
        2020.2.3