Class BuildSelector

    • Constructor Detail

      • BuildSelector

        public BuildSelector()
    • Method Detail

      • getBuild

        public Run<?,​?> getBuild​(Job<?,​?> job,
                                       EnvVars env,
                                       BuildFilter filter,
                                       Run<?,​?> parent)
        Find a build to copy artifacts from.
        Parameters:
        job - Source project
        env - Environment for build that is copying artifacts
        filter - Additional filter; returned result should return true (return null otherwise)
        parent - Build to which artifacts are being copied
        Returns:
        Build to use, or null if no appropriate build was found
      • getBuild

        @Deprecated
        public Run<?,​?> getBuild​(Job<?,​?> job,
                                       EnvVars env,
                                       BuildFilter filter)
        Deprecated.
        Find a build to copy artifacts from. Older and deprecated version of API.
        Parameters:
        job - Source project
        env - Environment for build that is copying artifacts
        filter - Additional filter; returned result should return true (return null otherwise)
        Returns:
        Build to use, or null if no appropriate build was found
      • isSelectable

        protected boolean isSelectable​(Run<?,​?> run,
                                       EnvVars env)
        Should this build be selected? Override just this method to use a standard loop through completed builds, starting with the most recent.
        Parameters:
        run - Build to check
        env - Environment for build that is copying artifacts
        Returns:
        True to select this build
      • isBuildResultBetterOrEqualTo

        protected static boolean isBuildResultBetterOrEqualTo​(Run<?,​?> run,
                                                              Result resultToTest)
        Wrapper for Result.isBetterOrEqualTo(Result) with null checks. Returns false if run is null or run is still running.
        Parameters:
        run - Build to test.
        resultToTest - Result to test.
        Returns:
        false if run is null or run is still running.
        See Also:
        Result.isBetterOrEqualTo(Result)