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

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

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • None

      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

       

          [JENKINS-45273] Pipeline Multibranch - Add the possibility to use a Jenkinsfile from other SCM

          Mariela Daventini created issue -
          Andrew Bayer made changes -
          Component/s New: workflow-multibranch-plugin [ 21465 ]
          Component/s Original: pipeline [ 21692 ]

          Jesse Glick added a comment -

          Had difficulty following this description but sounds like a dupe of JENKINS-43749.

          Jesse Glick added a comment - Had difficulty following this description but sounds like a dupe of  JENKINS-43749 .
          Jesse Glick made changes -
          Link New: This issue duplicates JENKINS-43749 [ JENKINS-43749 ]
          Jesse Glick made changes -
          Resolution New: Duplicate [ 3 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

          This is not duplicated! JENKINS-43749 talk about many Jenkinsfiles in the same repo which is solved by JENKINS-34561

          As a workaround we will create a script to propagate our Jenkinsfile to desired repos and a pre-commit hook to prevent write from developers, because is the corporative Jenkinsfile.

          What we need is to apply our Jenkinsfile (let's name DOCorporateJenkinsfile) getting the code from other repo.

          As a proposal: Jenkins can check a i.e:DOCorporateJenkinsfile, mark as "Met criteria" but load the DOCorporateJenkinsfile from other SCM. What it needs? A check to load the file from other location, and the SCM location (as Pipeline Libraries config)

          I hope to be clearer this time! 

          Thanks in advance!!! 

           

          Mariela Daventini added a comment - This is not duplicated!  JENKINS-43749  talk about many Jenkinsfiles in the same repo which is solved by  JENKINS-34561 As a workaround we will create a script to propagate our Jenkinsfile to desired repos and a pre-commit hook to prevent write from developers, because is the corporative Jenkinsfile. What we need is to apply our Jenkinsfile (let's name DOCorporateJenkinsfile) getting the code from other repo. As a proposal:  Jenkins can check a i.e:DOCorporateJenkinsfile, mark as "Met criteria" but load the DOCorporateJenkinsfile from other SCM.  What it needs? A check to load the file from other location, and the SCM location (as Pipeline Libraries  config) I hope to be clearer this time!  Thanks in advance!!!   
          Mariela Daventini made changes -
          Status Original: Resolved [ 5 ] New: In Review [ 10005 ]
          Mariela Daventini made changes -
          Remote Link New: This issue links to "related (Web Link)" [ 17404 ]
          Jesse Glick made changes -
          Status Original: In Review [ 10005 ] New: In Progress [ 3 ]
          Jesse Glick made changes -
          Resolution Original: Duplicate [ 3 ]
          Status Original: In Progress [ 3 ] New: Open [ 1 ]

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

              Created:
              Updated:
              Resolved: