0

Background

We have multiple declarative pipeline jobs that can be selected and built in order as downstream jobs from a Master pipeline job. This will wait for each triggered job to complete before starting the next one inline.

Each of the downstream jobs has an input stage where it will wait for user input for artifact promotion before continuing on.

The Problem

Is it possible to have the Master Job continue and start the next job in line once the current job hits the input stage? i.e. not to wait for the user input before starting the next job inline

From what I see the only options here are wait: true/false AND quietPeriod: to put in a delay. The example below shows these options but neither are suitable for our scenario.

build (job: 'myJob1', parameters: [booleanParam (name: 'startServer', value: false)], quietPeriod: 10, wait: true)
build (job: 'myJob2', parameters: [booleanParam (name: 'startServer', value: false)], quietPeriod: 10, wait: true)
Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
neil201
  • 33
  • 1
  • 6

1 Answers1

0

Checkout Parallel Stages, it's exactly what you're looking for.

parallel one: {
    stage ('Starting Test') 
    {
        build (job: 'myJob1', parameters: [booleanParam (name: 'startServer', value: false)], quietPeriod: 60, wait: false)
    }
}, two: {
    stage ('Starting Test2') 
    {
        build (job: 'myJob2', parameters: [booleanParam (name: 'startServer', value: false)], quietPeriod: 60, wait: false)
    }
}
3sky
  • 830
  • 1
  • 7
  • 16
  • thanks for the reply however I think you misunderstood the problem or I didn't explain clearly (edited my post to try and clarify). I don't actually want to run the jobs in Parallel, they need to wait and run sequentially. What I'm looking for is to run the next job as soon as the current one hits the input stage rather just wait until its completion. i.e. not waiting for the manual user input. – neil201 Jul 25 '18 at 08:29
  • `wait: false` is not enough ? – 3sky Jul 25 '18 at 08:55
  • unfortunately not as some of the jobs are preforming deployments of certain components that need to happen before others execute, therefore there is a need to wait for the previous job to have reached a certain stage. – neil201 Jul 25 '18 at 09:46