Class RemoteJenkinsFileWorkflowBranchProjectFactory

  • All Implemented Interfaces:
    ExtensionPoint, Describable<jenkins.branch.BranchProjectFactory<?,​?>>, Saveable

    public class RemoteJenkinsFileWorkflowBranchProjectFactory
    extends org.jenkinsci.plugins.workflow.multibranch.WorkflowBranchProjectFactory
    This class extends WorkflowBranchProjectFactory to inject defined Jenkins file and repository in Remote Jenkins File Plugin
    Author:
    Aytunc BEKEN, aytuncbeken.ab@gmail.com
    • Constructor Detail

      • RemoteJenkinsFileWorkflowBranchProjectFactory

        @DataBoundConstructor
        public RemoteJenkinsFileWorkflowBranchProjectFactory​(String remoteJenkinsFile,
                                                             String localMarker,
                                                             SCM remoteJenkinsFileSCM,
                                                             Boolean matchBranches,
                                                             String fallbackBranch,
                                                             Boolean lookupInParameters)
        Jenkins DataBoundConstructor
        Parameters:
        localMarker - path of an arbitrary local file which must be present for the project to be recognised
        remoteJenkinsFile - path of the Jenkinsfile
        remoteJenkinsFileSCM - SCM definition for the Jenkinsfile
    • Method Detail

      • getLookupInParameters

        public Boolean getLookupInParameters()
      • setLookupInParameters

        @DataBoundSetter
        public void setLookupInParameters​(Boolean lookupInParameters)
      • setRemoteJenkinsFile

        @DataBoundSetter
        public void setRemoteJenkinsFile​(String remoteJenkinsFile)
        Jenkins DataBoundSetter
        Parameters:
        remoteJenkinsFile - path of the Jenkinsfile
      • setRemoteJenkinsFileSCM

        @DataBoundSetter
        public void setRemoteJenkinsFileSCM​(SCM remoteJenkinsFileSCM)
        Jenkins DataBoundSetter
        Parameters:
        remoteJenkinsFileSCM - SCM definition for the Jenkinsfile
      • createDefinition

        protected org.jenkinsci.plugins.workflow.flow.FlowDefinition createDefinition()
        Extends WorkflowBranchProjectFactory
        Overrides:
        createDefinition in class org.jenkinsci.plugins.workflow.multibranch.WorkflowBranchProjectFactory
        Returns:
        FlowDefinition
      • getSCMSourceCriteria

        protected jenkins.scm.api.SCMSourceCriteria getSCMSourceCriteria​(jenkins.scm.api.SCMSource source)
        Extends WorkflowBranchProjectFactory
        Overrides:
        getSCMSourceCriteria in class org.jenkinsci.plugins.workflow.multibranch.WorkflowBranchProjectFactory
        Parameters:
        source - SCMSource
        Returns:
        SCMSourceCriteria
      • getRemoteJenkinsFile

        public String getRemoteJenkinsFile()
        Default getter method
        Returns:
        remoteJenkinsFile
      • getRemoteJenkinsFileSCM

        public SCM getRemoteJenkinsFileSCM()
        Default getter method
        Returns:
        remoteJenkinsFile
      • getLocalMarker

        public String getLocalMarker()
        Default getter method
        Returns:
        localMarker
      • setMatchBranches

        @DataBoundSetter
        public void setMatchBranches​(boolean matchBranches)
        Jenkins DataBoundSetter
        Parameters:
        matchBranches - True to enable match branches feature
      • getMatchBranches

        public boolean getMatchBranches()
        Default getter method
        Returns:
        matchBranches
      • setScmSourceBranchName

        public void setScmSourceBranchName​(String scmSourceBranchName)
        Set scmSourceBranchName to be used in new scm definition with new branch name
        Parameters:
        scmSourceBranchName - Current branch name which MultiBranch pipeline working on.
      • getScmSourceBranchName

        public String getScmSourceBranchName()
        Default getter method
        Returns:
        scmSourceBranchName
      • getFallbackBranch

        public String getFallbackBranch()
      • setFallbackBranch

        @DataBoundSetter
        public void setFallbackBranch​(String fallbackBranch)