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

Pipeline Multibranch - Add the possibility to use a Jenkinsfile from other SCM

    Details

    • Similar Issues:

      Description

      We need to have different Declarative Pipelines per roles/definitions  (role: developers; role: DevOps)

      Declarative Jenkinsfile for developers: in maven-java project is Jenkinsfile

      Declarative Jenkinsfile for DevOps: in generic devops project

      In Scan Multibranch Pipeline:

      *Case 1:

      -Branch Sources: maven-java project http://svn/VersionesJenkins20

      -Build Configuration by Jenkinsfile Script Path ../../Jenkins/Pipeline/trunk/Jenkinsfile

      Scan Multibranch Pipeline Log ERROR:

      ERROR: [Mon Jul 03 14:18:06 ART 2017] Could not fetch branches from source 90b1b9e5-a010-4b1a-a717-2a2b51b9e42e
      java.io.IOException: org.tmatesoft.svn.core.SVNException: svn: E125002: URL 'http://svn/VersionesJenkins20/branches/VersionesJenkins20-sinFileJenkins/../..' contains .. element

      *Case 2:

      -Branch Sources: maven-java project http://svn/VersionesJenkins20 + generic devops project http://svn/Jenkins/Pipeline/trunk/

      -Build Configuration by Jenkinsfile Script Path Jenkinsfile

      PROBLEM: Jenkins runs Jenkinsfile from maven-java project ignoring generic devops project

       

      POSSIBLE SOLUTION:

      -Allow to define shared workspace with Jenkins file

      -Allow to define scm svn to the declarative devops jenkinsfile

       

        Attachments

          Issue Links

            Activity

            Hide
            mdaventini Mariela Daventini added a comment -

            I think so Sam Van Oort

            If any voter needs support, I really recomend using shared libraries!

            Show
            mdaventini Mariela Daventini added a comment - I think so Sam Van Oort !  If any voter needs support, I really recomend using shared libraries!
            Hide
            mrichar2 Mark R added a comment -

            Use case: I have a forked opensource repo that I want to make changes to but don't want to pollute with a Jenkinsfile to build with internally. The Jenkinsfile must thus be in a different repository (without playing games in git to "hide" the Jenkinsfile commit(s)). If however I put it in a different repository I loose the ability to have bitbucket trigger the job on push to automatically build branches - right now it will only detect changes from the repository that has the Jenkinsfile which really won't change.

            Show
            mrichar2 Mark R added a comment - Use case: I have a forked opensource repo that I want to make changes to but don't want to pollute with a Jenkinsfile to build with internally. The Jenkinsfile must thus be in a different repository (without playing games in git to "hide" the Jenkinsfile commit(s)). If however I put it in a different repository I loose the ability to have bitbucket trigger the job on push to automatically build branches - right now it will only detect changes from the repository that has the Jenkinsfile which really won't change.
            Hide
            jglick Jesse Glick added a comment -

            Mark R you can use the Pipeline Multibranch Defaults plugin for this, or if you are a CloudBees customer there is a “custom marker file” feature which is more flexible still.

            Show
            jglick Jesse Glick added a comment - Mark R you can use the Pipeline Multibranch Defaults plugin for this, or if you are a CloudBees customer there is a “custom marker file” feature which is more flexible still.
            Hide
            dnusbaum Devin Nusbaum added a comment -

            I am closing this ticket. As far as I know there are two open source plugins that support this use case directly:

            As Jesse mentioned, CloudBees also implemented a feature like this for CloudBees customers, see the documentation here.

            If those plugins do not have the features you want, I would open an RFE against the one you want to use, describing your use case and explaining why the current functionality of the plugin is not adequate.

            Show
            dnusbaum Devin Nusbaum added a comment - I am closing this ticket. As far as I know there are two open source plugins that support this use case directly: Pipeline: Multibranch with defaults Remote File Plugin (CC Aytunc BEKEN , any thoughts about changing the display name of the plugin to something like "Pipeline Multibranch Remote Jenkinsfile Plugin" for clarity and so that users are more likely to find it when searching?) As Jesse mentioned, CloudBees also implemented a feature like this for CloudBees customers, see the documentation here . If those plugins do not have the features you want, I would open an RFE against the one you want to use, describing your use case and explaining why the current functionality of the plugin is not adequate.
            Hide
            aytuncbeken Aytunc BEKEN added a comment - - edited

            Devin Nusbaum I agree with you, I will try to change the plugin name. Thanks for the suggestion.

            Show
            aytuncbeken Aytunc BEKEN added a comment - - edited Devin Nusbaum I agree with you, I will try to change the plugin name. Thanks for the suggestion.

              People

              • Assignee:
                Unassigned
                Reporter:
                mdaventini Mariela Daventini
              • Votes:
                8 Vote for this issue
                Watchers:
                15 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: