Search code examples
jenkinscontinuous-integrationjenkins-pipelinemultibranch-pipeline

Jenkins declarative pipeline - Trigger Jenkinsfile from another Jenkinsfile


I have a Jenkins MultiBranch pipeline project that points to a Jenkinsfile in my git repo. I want it to trigger another Jenkinsfile that is located in the same repo but in different folder.

How can it be done?

Thanks!!!


Solution

  • Just solved it with adding this section to the pipeline:

    script {
      def util = load("${env.WORKSPACE}/Jenkins/vars/ScriptedPipeline.groovy")
      util.DoSomething()
    }