Class AbstractMultiBranchCreateRequest


  • public abstract class AbstractMultiBranchCreateRequest
    extends AbstractPipelineCreateRequest
    Creates MultiBranchProjects with a single SCMSource
    • Constructor Detail

      • AbstractMultiBranchCreateRequest

        public AbstractMultiBranchCreateRequest​(String name,
                                                io.jenkins.blueocean.rest.model.BlueScmConfig scmConfig)
    • Method Detail

      • create

        public io.jenkins.blueocean.rest.model.BluePipeline create​(@NonNull
                                                                   io.jenkins.blueocean.rest.model.BlueOrganization organization,
                                                                   @NonNull
                                                                   io.jenkins.blueocean.rest.Reachable parent)
                                                            throws IOException
        Specified by:
        create in class io.jenkins.blueocean.rest.model.BluePipelineCreateRequest
        Throws:
        IOException
      • getScmSourceEvent

        @Nullable
        protected AbstractScmSourceEvent getScmSourceEvent​(@NonNull
                                                           jenkins.branch.MultiBranchProject project,
                                                           @NonNull
                                                           jenkins.scm.api.SCMSource source)
        Returns:
        Get SCMSourceEvent
      • createSource

        protected abstract jenkins.scm.api.SCMSource createSource​(@NonNull
                                                                  jenkins.branch.MultiBranchProject project,
                                                                  @NonNull
                                                                  io.jenkins.blueocean.rest.model.BlueScmConfig scmConfig)
        Create the source for the MultiBranchProject created with this request
        Parameters:
        project - that was created
        scmConfig - config
        Returns:
        valid SCMSource
      • validate

        protected abstract List<io.jenkins.blueocean.commons.ErrorMessage.Error> validate​(String name,
                                                                                          io.jenkins.blueocean.rest.model.BlueScmConfig scmConfig)
        Validate the provided SCMConfig and test that a connection can be made to the SCM server
        Parameters:
        name - of pipeline being created
        scmConfig - to validate
        Returns:
        errors occurring during validation
      • repoHasJenkinsFile

        protected boolean repoHasJenkinsFile​(@NonNull
                                             jenkins.scm.api.SCMSource scmSource)
        Certain SCMSource can tell whether it can detect presence of Jenkinsfile across all branches
        Parameters:
        scmSource - scm source
        Returns:
        true as default. false if it can determine there is no Jenkinsfile in all branches