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

Create a build job from pipeline - as like pipelineJob does for JenkinsDSL

    XMLWordPrintable

Details

    Description

      Actually I'm evaluating different possibilites to better restructure our complex CD/CI pipeline.

      One of the things I stumpled on was:

      I'm able to start a defined job by it's known name

      build job: 'knownJobname'

      but I'm unable to create the job itself, if it doesn't already exist from the multibranch-pipline Job: desired

      build job: 'knownJobname', from 'Jenkinsfile.job.knownJobname.groovy'

      which should

      1. checks for the given job
      2. updates or creates the job
        1. perhaps should auto-update the name for multipipeline builds
      3. run the build job with the given parameters

       

      actually it just fails if the job doesn't exist: https://github.com/jenkinsci/pipeline-build-step-plugin/blob/4512e19/src/main/java/org/jenkinsci/plugins/workflow/support/steps/build/BuildTriggerStep.java#L100

       

      In JenkinsDSL there was a pipelineJob which solved this:
      https://jenkinsci.github.io/job-dsl-plugin/#path/pipelineJob
       

      I'm quite unsure which of the "pluged in steps" is affected or should do/cover this.
      The nearest hit is indeed https://plugins.jenkins.io/pipeline-build-step itself, but perhaps there should be a another "plugin" for it, or bundled in any "-support" / "-api" or "-cps-" plugin?!

       

      P.S: should https://plugins.jenkins.io/workflow-job do the job?! I'm lost in documentations ;(
      ^ no, it's the Pipeline Job itself, not a step definition "plugin"

      Attachments

        Activity

          childnode Marcel 'childNo͡.de' Trautwein created issue -
          childnode Marcel 'childNo͡.de' Trautwein made changes -
          Field Original Value New Value
          Epic Link JENKINS-35386 [ 171179 ]
          childnode Marcel 'childNo͡.de' Trautwein made changes -
          Description Actually I'm evaluating different possibilites to better restructure our complex CD/CI pipeline.

          One of the things I stumpled on was:

          I'm able to start a defined job by it's known name
          {code:java}
          build job: 'knownJobname'{code}
          but I'm unable to create the job itself, if it doesn't already exist from the multibranch-pipline Job: desired
          {code:java}
          build job: 'knownJobname', from 'Jenkinsfile.job.knownJobname.groovy'{code}
          which should
           # checks for the given job
           # updates or creates the job
           ## perhaps should auto-update the name for multipipeline builds
           # run the build job with the given parameters

           

          actually it just fails if the job doesn't exist: [https://github.com/jenkinsci/pipeline-build-step-plugin/blob/4512e19/src/main/java/org/jenkinsci/plugins/workflow/support/steps/build/BuildTriggerStep.java#L100]

           

          In JenkinsDSL there was a {{pipelineJob}} which solved this:
           [https://jenkinsci.github.io/job-dsl-plugin/#path/pipelineJob]
            

          I'm quite unsure which of the ["pluged in steps"|https://jenkins.io/doc/pipeline/steps/] is affected or should do/cover this.
           The nearest hit is indeed [https://plugins.jenkins.io/pipeline-build-step] itself, but perhaps there should be a another "plugin" for it, or bundled in any "-support" / "-api" or "-cps-" plugin?!
          Actually I'm evaluating different possibilites to better restructure our complex CD/CI pipeline.

          One of the things I stumpled on was:

          I'm able to start a defined job by it's known name
          {code:java}
          build job: 'knownJobname'{code}
          but I'm unable to create the job itself, if it doesn't already exist from the multibranch-pipline Job: desired
          {code:java}
          build job: 'knownJobname', from 'Jenkinsfile.job.knownJobname.groovy'{code}
          which should
           # checks for the given job
           # updates or creates the job
           ## perhaps should auto-update the name for multipipeline builds
           # run the build job with the given parameters

           

          actually it just fails if the job doesn't exist: [https://github.com/jenkinsci/pipeline-build-step-plugin/blob/4512e19/src/main/java/org/jenkinsci/plugins/workflow/support/steps/build/BuildTriggerStep.java#L100]

           

          In JenkinsDSL there was a {{pipelineJob}} which solved this:
           [https://jenkinsci.github.io/job-dsl-plugin/#path/pipelineJob]
            

          I'm quite unsure which of the ["pluged in steps"|https://jenkins.io/doc/pipeline/steps/] is affected or should do/cover this.
           The nearest hit is indeed [https://plugins.jenkins.io/pipeline-build-step] itself, but perhaps there should be a another "plugin" for it, or bundled in any "\-support" / "\-api" or "\-cps-" plugin?!
          childnode Marcel 'childNo͡.de' Trautwein made changes -
          Description Actually I'm evaluating different possibilites to better restructure our complex CD/CI pipeline.

          One of the things I stumpled on was:

          I'm able to start a defined job by it's known name
          {code:java}
          build job: 'knownJobname'{code}
          but I'm unable to create the job itself, if it doesn't already exist from the multibranch-pipline Job: desired
          {code:java}
          build job: 'knownJobname', from 'Jenkinsfile.job.knownJobname.groovy'{code}
          which should
           # checks for the given job
           # updates or creates the job
           ## perhaps should auto-update the name for multipipeline builds
           # run the build job with the given parameters

           

          actually it just fails if the job doesn't exist: [https://github.com/jenkinsci/pipeline-build-step-plugin/blob/4512e19/src/main/java/org/jenkinsci/plugins/workflow/support/steps/build/BuildTriggerStep.java#L100]

           

          In JenkinsDSL there was a {{pipelineJob}} which solved this:
           [https://jenkinsci.github.io/job-dsl-plugin/#path/pipelineJob]
            

          I'm quite unsure which of the ["pluged in steps"|https://jenkins.io/doc/pipeline/steps/] is affected or should do/cover this.
           The nearest hit is indeed [https://plugins.jenkins.io/pipeline-build-step] itself, but perhaps there should be a another "plugin" for it, or bundled in any "\-support" / "\-api" or "\-cps-" plugin?!
          Actually I'm evaluating different possibilites to better restructure our complex CD/CI pipeline.

          One of the things I stumpled on was:

          I'm able to start a defined job by it's known name
          {code:java}
          build job: 'knownJobname'{code}
          but I'm unable to create the job itself, if it doesn't already exist from the multibranch-pipline Job: desired
          {code:java}
          build job: 'knownJobname', from 'Jenkinsfile.job.knownJobname.groovy'{code}
          which should
           # checks for the given job
           # updates or creates the job
           ## perhaps should auto-update the name for multipipeline builds
           # run the build job with the given parameters

           

          actually it just fails if the job doesn't exist: [https://github.com/jenkinsci/pipeline-build-step-plugin/blob/4512e19/src/main/java/org/jenkinsci/plugins/workflow/support/steps/build/BuildTriggerStep.java#L100]

           

          In JenkinsDSL there was a {{pipelineJob}} which solved this:
           [https://jenkinsci.github.io/job-dsl-plugin/#path/pipelineJob]
            

          I'm quite unsure which of the ["pluged in steps"|https://jenkins.io/doc/pipeline/steps/] is affected or should do/cover this.
           The nearest hit is indeed [https://plugins.jenkins.io/pipeline-build-step] itself, but perhaps there should be a another "plugin" for it, or bundled in any "-support" / "-api" or "-cps-" plugin?!

           

          P.S: should [https://plugins.jenkins.io/workflow-job] do the job?! I'm lost in documentations ;(
          childnode Marcel 'childNo͡.de' Trautwein made changes -
          Description Actually I'm evaluating different possibilites to better restructure our complex CD/CI pipeline.

          One of the things I stumpled on was:

          I'm able to start a defined job by it's known name
          {code:java}
          build job: 'knownJobname'{code}
          but I'm unable to create the job itself, if it doesn't already exist from the multibranch-pipline Job: desired
          {code:java}
          build job: 'knownJobname', from 'Jenkinsfile.job.knownJobname.groovy'{code}
          which should
           # checks for the given job
           # updates or creates the job
           ## perhaps should auto-update the name for multipipeline builds
           # run the build job with the given parameters

           

          actually it just fails if the job doesn't exist: [https://github.com/jenkinsci/pipeline-build-step-plugin/blob/4512e19/src/main/java/org/jenkinsci/plugins/workflow/support/steps/build/BuildTriggerStep.java#L100]

           

          In JenkinsDSL there was a {{pipelineJob}} which solved this:
           [https://jenkinsci.github.io/job-dsl-plugin/#path/pipelineJob]
            

          I'm quite unsure which of the ["pluged in steps"|https://jenkins.io/doc/pipeline/steps/] is affected or should do/cover this.
           The nearest hit is indeed [https://plugins.jenkins.io/pipeline-build-step] itself, but perhaps there should be a another "plugin" for it, or bundled in any "-support" / "-api" or "-cps-" plugin?!

           

          P.S: should [https://plugins.jenkins.io/workflow-job] do the job?! I'm lost in documentations ;(
          Actually I'm evaluating different possibilites to better restructure our complex CD/CI pipeline.

          One of the things I stumpled on was:

          I'm able to start a defined job by it's known name
          {code:java}
          build job: 'knownJobname'{code}
          but I'm unable to create the job itself, if it doesn't already exist from the multibranch-pipline Job: desired
          {code:java}
          build job: 'knownJobname', from 'Jenkinsfile.job.knownJobname.groovy'{code}
          which should
           # checks for the given job
           # updates or creates the job
           ## perhaps should auto-update the name for multipipeline builds
           # run the build job with the given parameters

           

          actually it just fails if the job doesn't exist: [https://github.com/jenkinsci/pipeline-build-step-plugin/blob/4512e19/src/main/java/org/jenkinsci/plugins/workflow/support/steps/build/BuildTriggerStep.java#L100]

           

          In JenkinsDSL there was a {{pipelineJob}} which solved this:
           [https://jenkinsci.github.io/job-dsl-plugin/#path/pipelineJob]
            

          I'm quite unsure which of the ["pluged in steps"|https://jenkins.io/doc/pipeline/steps/] is affected or should do/cover this.
           The nearest hit is indeed [https://plugins.jenkins.io/pipeline-build-step] itself, but perhaps there should be a another "plugin" for it, or bundled in any "\-support" / "\-api" or "\-cps-" plugin?!

           

          -P.S: should [https://plugins.jenkins.io/workflow-job] do the job?! I'm lost in documentations ;(-
          ^ no, it's the Pipeline Job itself, not a step definition "plugin"
          jglick Jesse Glick made changes -
          Resolution Not A Defect [ 7 ]
          Status Open [ 1 ] Resolved [ 5 ]

          People

            Unassigned Unassigned
            childnode Marcel 'childNo͡.de' Trautwein
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: