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

Allow to detect different Jenkinsfile filenames

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      In multibranch pipeline and Github organization folder the name Jenkinsfile is hard-coded and always looks for the top level folder.

      It would be useful to have the option to search other specified files (even located in subfolders) to face cases like:

      • having multiple repo-scanners managed by one project that create different pipelines from the same repo (they do different things, executing on different schedules)
      • some git repos requires a project layout that forbids all root-level files with some exceptions

        Attachments

          Issue Links

            Activity

            Hide
            jglick Jesse Glick added a comment -

            There is inline help.

            Show
            jglick Jesse Glick added a comment - There is inline help.
            Hide
            audrius_idzelis Audrius Idzelis added a comment -

            I've just updated to 2.17 version and my Jenkins builds stopped working. I see that Jenkins files are not found anymore
            "test/Jenkinsfile’ not found"
            I have my Jenkins file in a subdirectory on each branch

            • test/Jenkinsfile

            And it seems that subdirectories are not checked properly in 2.17 version.

            If I move my Jenkinsfile to the root/HEAD of the branch then it is found and plugin works.

            Is this something that got changed in 2.17 version ?

            Show
            audrius_idzelis Audrius Idzelis added a comment - I've just updated to 2.17 version and my Jenkins builds stopped working. I see that Jenkins files are not found anymore "test/Jenkinsfile’ not found" I have my Jenkins file in a subdirectory on each branch test/Jenkinsfile And it seems that subdirectories are not checked properly in 2.17 version. If I move my Jenkinsfile to the root/HEAD of the branch then it is found and plugin works. Is this something that got changed in 2.17 version ?
            Hide
            merlindam Damien Merlin added a comment - - edited

            Hi Audrius, I think I got the same issue as you reported. But you misidentified the plugin. Check https://issues.jenkins-ci.org/browse/JENKINS-49261

            Show
            merlindam Damien Merlin added a comment - - edited Hi Audrius, I think I got the same issue as you reported. But you misidentified the plugin. Check https://issues.jenkins-ci.org/browse/JENKINS-49261
            Hide
            audrius_idzelis Audrius Idzelis added a comment -

            Hi Damien Merlin - you're right. Thank you for the update.

            Show
            audrius_idzelis Audrius Idzelis added a comment - Hi Damien Merlin - you're right. Thank you for the update.
            Hide
            niexiongfang xiongfang nie added a comment - - edited

            Hi there,

            I'm using this great feature, one problem I was seeking for help is that how can I get the jenkinsfile script name inside the jenkinsfile:

            say the project was cconfigured as 'jenkins/Jenkinsfile.k8s.test', is there a way to get the 'jenkins/Jenkinsfile.k8s.test' within script Jenkinsfile.k8s.test?

            I tried this.class.getName(), which simply returned: 'WorkflowScript'

            Basically, I'd like to use some naming convention on the jenkinsfile to save some configurations.

             

            thanks in advance!

             

            Show
            niexiongfang xiongfang nie added a comment - - edited Hi there, I'm using this great feature, one problem I was seeking for help is that how can I get the jenkinsfile script name inside the jenkinsfile: say the project was cconfigured as 'jenkins/Jenkinsfile.k8s.test', is there a way to get the 'jenkins/Jenkinsfile.k8s.test' within script Jenkinsfile.k8s.test? I tried this.class.getName(), which simply returned: 'WorkflowScript' Basically, I'd like to use some naming convention on the jenkinsfile to save some configurations.   thanks in advance!  

              People

              • Assignee:
                0x89 Martin Sander
                Reporter:
                dariver Darío Villadiego
              • Votes:
                42 Vote for this issue
                Watchers:
                54 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: