0
0
Jenkinsdevops~10 mins

What is Jenkins - Interactive Quiz & Practice

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

Complete the code to start a Jenkins job from the command line.

Jenkins
java -jar jenkins-cli.jar -s http://localhost:8080 [1] MyJob
Drag options to blanks, or click blank then click option'
Abuild
Bexecute
Cstart
Drun
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'run' or 'start' instead of 'build' causes errors.
2fill in blank
medium

Complete the Jenkinsfile snippet to define a pipeline stage.

Jenkins
pipeline {
  agent any
  stages {
    stage('[1]') {
      steps {
        echo 'Hello, Jenkins!'
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
ADeploy
BBuild
CTest
DInit
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing 'Deploy' or 'Test' when the example is about building.
3fill in blank
hard

Fix the error in the Jenkinsfile to correctly declare an environment variable.

Jenkins
pipeline {
  agent any
  environment {
    GREETING = '[1]'
  }
  stages {
    stage('Example') {
      steps {
        echo "${GREETING}, Jenkins!"
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
A'Hello'
BHello
CGREETING
D"Hello"
Attempts:
3 left
💡 Hint
Common Mistakes
Missing quotes causes syntax errors.
4fill in blank
hard

Fill both blanks to create a Jenkins pipeline that runs a shell command only on the master branch.

Jenkins
pipeline {
  agent any
  stages {
    stage('Build') {
      when {
        branch [1] '[2]'
      }
      steps {
        sh 'echo Building on master branch'
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
Aequals
Bmaster
Cdevelop
DnotEquals
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'notEquals' or wrong branch name causes the step to skip.
5fill in blank
hard

Fill all three blanks to define a Jenkins pipeline with parameters and a conditional step.

Jenkins
pipeline {
  agent any
  parameters {
    string(name: '[1]', defaultValue: 'World', description: 'Who to greet')
  }
  stages {
    stage('Greet') {
      steps {
        script {
          if (params.[2] == '[3]') {
            echo "Hello, ${params.NAME}!"
          }
        }
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
ANAME
CWorld
DGREETING
Attempts:
3 left
💡 Hint
Common Mistakes
Mismatched parameter names cause runtime errors.