Search code examples
jenkinsjenkins-pluginsjenkins-workflowjenkins-pipeline

Jenkins Workflow Multibranch allow for specifying Jenkinsfile path


It seems like now you can only have a single Jenkinsfile in a single location in your project when using Multibranch type.

Is there a way to configure so I can place the Jenkinsfile somewhere else than in the root of the project under the name Jenkinsfile. There's hope, as there's an option of Fixed Configuration, maybe this is a feature for the future, but I would much appreciate the option, as in the current situation I do not have the option to run everything as one nicely compiled pipeline due to the size of the repo. I'm thinking of having multiple Jenkins jobs against the same repository.

-- Marcus


Solution

  • Starting with Pipeline: Multibranch plugin version 2.15, you can specify the Jenkinsfile location in your configuration.

    See my answer at https://stackoverflow.com/a/45172149/2141666 and the plugin changelog at https://wiki.jenkins.io/display/JENKINS/Pipeline+Multibranch+Plugin. From the changelog:

    2.15 (Jun 01, 2017)

    JENKINS-34561 Option to select a script name/path other than Jenkinsfile.