Complete the code to trigger a downstream job named 'BuildApp'.
build job: '[1]'
The build job: 'BuildApp' command triggers the downstream job named 'BuildApp'.
Complete the code to trigger a job and wait for its completion.
build job: 'TestApp', wait: [1]
Setting wait: true makes the pipeline wait for the triggered job to finish before continuing.
Fix the error in the trigger syntax to correctly trigger the downstream job.
[1] job: 'BuildApp'
The correct Jenkins pipeline syntax to trigger a job is build, not trigger or others.
Fill both blanks to define a pipeline that triggers 'TestApp' after 'BuildApp' completes.
pipeline {
stages {
stage('Build') {
steps {
build job: '[1]'
}
}
stage('Test') {
steps {
build job: '[2]'
}
}
}
}The first stage triggers 'BuildApp', and after it completes, the second stage triggers 'TestApp'.
Fill all three blanks to create a pipeline that triggers 'BuildApp', waits for it, then triggers 'TestApp' with parameters.
pipeline {
stages {
stage('Build') {
steps {
build job: '[1]', wait: [2]
}
}
stage('Test') {
steps {
build job: '[3]', parameters: [string(name: 'ENV', value: 'prod')]
}
}
}
}The pipeline triggers 'BuildApp' and waits for it to finish (wait: true), then triggers 'TestApp' with a parameter.