0
0
Jenkinsdevops~10 mins

Pipeline triggers and upstream/downstream in Jenkins - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to trigger a downstream job named 'BuildApp'.

Jenkins
build job: '[1]'
Drag options to blanks, or click blank then click option'
ADeployApp
BBuildApp
CTestApp
DCleanApp
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong job name that does not exist.
Forgetting to put the job name in quotes.
2fill in blank
medium

Complete the code to trigger a job and wait for its completion.

Jenkins
build job: 'TestApp', wait: [1]
Drag options to blanks, or click blank then click option'
Atrue
Bfalse
Cmaybe
Dnull
Attempts:
3 left
💡 Hint
Common Mistakes
Using a string instead of a boolean.
Setting wait to false when you want to wait.
3fill in blank
hard

Fix the error in the trigger syntax to correctly trigger the downstream job.

Jenkins
[1] job: 'BuildApp'
Drag options to blanks, or click blank then click option'
Abuild
Bstart
Crun
Dexecute
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'trigger' instead of 'build'.
Using 'start' which is not a Jenkins pipeline step.
4fill in blank
hard

Fill both blanks to define a pipeline that triggers 'TestApp' after 'BuildApp' completes.

Jenkins
pipeline {
  stages {
    stage('Build') {
      steps {
        build job: '[1]'
      }
    }
    stage('Test') {
      steps {
        build job: '[2]'
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
ABuildApp
BDeployApp
CTestApp
DCleanApp
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping the job names in the stages.
Using job names that do not exist.
5fill in blank
hard

Fill all three blanks to create a pipeline that triggers 'BuildApp', waits for it, then triggers 'TestApp' with parameters.

Jenkins
pipeline {
  stages {
    stage('Build') {
      steps {
        build job: '[1]', wait: [2]
      }
    }
    stage('Test') {
      steps {
        build job: '[3]', parameters: [string(name: 'ENV', value: 'prod')]
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
ABuildApp
Btrue
CTestApp
Dfalse
Attempts:
3 left
💡 Hint
Common Mistakes
Not waiting for the build job to finish.
Using wrong job names or missing parameters.