Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-38171

Project Recognizer for Jenkinsfile in another repository.

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      The "Project Recognizer" only has one option in a GitHub Organization Folder project: "Pipeline Jenkinsfile". It should be possible to have other options for this such as specifying a repository where the Jenkinsfile can be obtained.

      If this is not functionality that will not be added for whatever reason: can you let me know what I'd need to hook into if I were to write a plugin to achieve this?

      Thanks!

        Attachments

          Activity

          Hide
          joshuakegley Joshua Kegley added a comment -

          I'd like to also know where this. I want to support JSON or other file formats.

          Show
          joshuakegley Joshua Kegley added a comment - I'd like to also know where this. I want to support JSON or other file formats.
          Hide
          stephenconnolly Stephen Connolly added a comment -

          https://github.com/jenkinsci/workflow-multibranch-plugin/blob/c49261f827d032a637475071ba6742f0c40a8653/src/main/java/org/jenkinsci/plugins/workflow/multibranch/AbstractWorkflowBranchProjectFactory.java#L50 defines the SCMSourceCriteria from which the decision as to whether a branch should get a job or not is made.

          (see https://github.com/jenkinsci/workflow-multibranch-plugin/blob/c49261f827d032a637475071ba6742f0c40a8653/src/main/java/org/jenkinsci/plugins/workflow/multibranch/WorkflowMultiBranchProject.java#L67-L69 for where that logic gets applied)

          Thus what you'd need to do is implement your own {{AbstractWorkflowBranchProjectFactory} subclass... you can probably base most of it off https://github.com/jenkinsci/workflow-multibranch-plugin/blob/master/src/main/java/org/jenkinsci/plugins/workflow/multibranch/WorkflowBranchProjectFactory.java

          Your implementation can be in its own extension plugin rather than having to try and get it merged into workflow-multibranch

          If you want to build something that is not pipeline backed then you are in the realm of implementing your own multibranch project sub-type (workflow-multibranch is one example, literate is another, etc) For that I would consult the docs subfolder of the branch-api git repo

          Show
          stephenconnolly Stephen Connolly added a comment - https://github.com/jenkinsci/workflow-multibranch-plugin/blob/c49261f827d032a637475071ba6742f0c40a8653/src/main/java/org/jenkinsci/plugins/workflow/multibranch/AbstractWorkflowBranchProjectFactory.java#L50  defines the SCMSourceCriteria from which the decision as to whether a branch should get a job or not is made. (see https://github.com/jenkinsci/workflow-multibranch-plugin/blob/c49261f827d032a637475071ba6742f0c40a8653/src/main/java/org/jenkinsci/plugins/workflow/multibranch/WorkflowMultiBranchProject.java#L67-L69  for where that logic gets applied) Thus what you'd need to do is implement your own {{AbstractWorkflowBranchProjectFactory} subclass... you can probably base most of it off https://github.com/jenkinsci/workflow-multibranch-plugin/blob/master/src/main/java/org/jenkinsci/plugins/workflow/multibranch/WorkflowBranchProjectFactory.java Your implementation can be in its own extension plugin rather than having to try and get it merged into workflow-multibranch If you want to build something that is not pipeline backed then you are in the realm of implementing your own multibranch project sub-type (workflow-multibranch is one example, literate is another, etc) For that I would consult the docs subfolder of the branch-api git repo

            People

            • Assignee:
              Unassigned
              Reporter:
              mikemcquaid Mike McQuaid
            • Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: