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

Add support for triggering builds of Pipeline job type

    Details

    • Type: Improvement
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Component/s: build-flow-plugin
    • Labels:
      None
    • Environment:
      Jenkins 2.7.1
      Build Flow plugin 0.20
      Pipeline: Job 2.3
    • Similar Issues:

      Description

      We like to use the Build Flow plugin to orchestrate Pipeline jobs. Even though Pipeline job type is suppose to replace the Build Flow job, it does not do a good job in displaying a graph of downstream jobs involved as part of a build pipeline, therefore it's not useful when displaying complex orchestration.

      Right now when calling a job of type Pipeline, a JobNotFoundException gets thrown:

      com.cloudbees.plugins.flow.JobNotFoundException: Item pipeline-job not found (or isn't a job).
      

      Based on https://github.com/jenkinsci/pipeline-plugin/blob/master/DEVGUIDE.md, seems like possibly the references of AbstractProject should be updated to be Job and AbstractBuild should be updated to be Run to get it to work with Pipeline type jobs.

        Attachments

          Activity

          Hide
          childnode Marcel 'childNo͡.de' Trautwein added a comment -

          perhaps this would be solved by or in conjunction with JENKINS-27299

          Show
          childnode Marcel 'childNo͡.de' Trautwein added a comment - perhaps this would be solved by or in conjunction with JENKINS-27299
          Hide
          nimrod Kasia Gauza added a comment -

          Craig Rodrigues what is the status? Is anyone working on this?

          Show
          nimrod Kasia Gauza added a comment - Craig Rodrigues what is the status? Is anyone working on this?
          Hide
          larsla Lars Larsson added a comment -

          Still no updates on this issue?
          I just got stuck because of it.

          Is there any workaround for triggering (and waiting for execution to finish) Pipeline jobs with parameters from Flow jobs?
          I managed to run jobs with the below code, but I can't figure out how to pass parameters this way...

          import jenkins.model.*
          
          def buildJob(name) {
            def j = Jenkins.instance.getItem(name)
            def nextId = j.getNextBuildNumber()
            println "Scheduling build: ${name} #${nextId}"
            j.scheduleBuild()
            while (j.getBuildByNumber(nextId) == null) sleep(1) {
              j = Jenkins.instance.getItem(name)
            }
            
            def build = j.getBuildByNumber(nextId)
            println "Build ${build} started"
             
            while(build == null || build.isBuilding()) sleep(1) {
              sleep(1)
              build = j.getBuildByNumber(nextId)
            }
            println "Build ${build} finished with status: " + build.getResult()
            
            return build.getResult()
          }
          
          
          
          Show
          larsla Lars Larsson added a comment - Still no updates on this issue? I just got stuck because of it. Is there any workaround for triggering (and waiting for execution to finish) Pipeline jobs with parameters from Flow jobs? I managed to run jobs with the below code, but I can't figure out how to pass parameters this way... import jenkins.model.* def buildJob(name) { def j = Jenkins.instance.getItem(name) def nextId = j.getNextBuildNumber() println "Scheduling build: ${name} #${nextId}" j.scheduleBuild() while (j.getBuildByNumber(nextId) == null ) sleep(1) { j = Jenkins.instance.getItem(name) } def build = j.getBuildByNumber(nextId) println "Build ${build} started" while (build == null || build.isBuilding()) sleep(1) { sleep(1) build = j.getBuildByNumber(nextId) } println "Build ${build} finished with status: " + build.getResult() return build.getResult() }

            People

            • Assignee:
              Unassigned
              Reporter:
              jlin jlin
            • Votes:
              3 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated: