Class BuildUtil


  • public final class BuildUtil
    extends Object
    Provides helper methods for #hudson.model.AbstractBuild
    Author:
    Centrum Systems
    • Constructor Detail

      • BuildUtil

        public BuildUtil()
    • Method Detail

      • getDownstreamBuild

        public static AbstractBuild<?,​?> getDownstreamBuild​(AbstractProject<?,​?> downstreamProject,
                                                                  AbstractBuild<?,​?> upstreamBuild)
        Gets the next downstream build based on the upstream build and downstream project.
        Parameters:
        downstreamProject - - The downstream project
        upstreamBuild - - The upstream build
        Returns:
        - The next downstream build based on the upstream build and downstream project, or null if there is no downstream project.
      • getAllBuildParametersAction

        public static Action getAllBuildParametersAction​(AbstractBuild<?,​?> upstreamBuild,
                                                         AbstractProject<?,​?> downstreamProject)
        Given an Upstream AbstractBuild and a Downstream AbstractProject will retrieve the associated ParametersAction. This will result in parameters from the upstream build not overriding parameters on the downstream project.
        Parameters:
        upstreamBuild - - The AbstractBuild
        downstreamProject - - The AbstractProject
        Returns:
        - AbstractBuild's ParametersAction
      • getBuildParametersAction

        public static ParametersAction getBuildParametersAction​(AbstractBuild<?,​?> build)
        Gets the ParametersAction of an AbstractBuild
        Parameters:
        build - - AbstractBuild
        Returns:
        - ParametersAction of AbstractBuild
      • mergeParameters

        public static ParametersAction mergeParameters​(ParametersAction base,
                                                       ParametersAction overlay)
        Merges two sets of ParametersAction
        Parameters:
        base - ParametersAction set 1
        overlay - ParametersAction set 2
        Returns:
        - Single set of ParametersAction
      • getUnsensitiveParameters

        public static Map<String,​String> getUnsensitiveParameters​(AbstractBuild<?,​?> build)
        Retrieve build parameters in String format without sensitive parameters (passwords, ...)
        Parameters:
        build - the build we retrieve the parameters from
        Returns:
        a map of parameters names and values