0
0
Jenkinsdevops~10 mins

Why proper setup matters in Jenkins - Test Your Understanding

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

Complete the code to start the Jenkins service.

Jenkins
sudo systemctl [1] jenkins
Drag options to blanks, or click blank then click option'
Astart
Bstop
Crestart
Dstatus
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'stop' instead of 'start' will turn off Jenkins.
Using 'status' only shows info, does not start.
2fill in blank
medium

Complete the code to check if Jenkins is running.

Jenkins
sudo systemctl [1] jenkins
Drag options to blanks, or click blank then click option'
Aenable
Bdisable
Cstatus
Dstart
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'start' will try to launch Jenkins again.
Using 'enable' changes startup behavior but doesn't show status.
3fill in blank
hard

Fix the error in the command to reload Jenkins configuration without restarting.

Jenkins
sudo systemctl [1] jenkins
Drag options to blanks, or click blank then click option'
Astart
Bstop
Crestart
Dreload
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'restart' causes downtime.
Using 'stop' turns Jenkins off.
4fill in blank
hard

Fill both blanks to create a Jenkins job that runs a shell command and only triggers on changes.

Jenkins
pipeline {
  agent any
  triggers {
    [1]('[2]')
  }
  stages {
    stage('Build') {
      steps {
        sh 'echo Building...'
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
ApollSCM
Bcron
CH/5 * * * *
DH/15 * * * *
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'cron' instead of 'pollSCM' triggers on time, not changes.
Wrong cron syntax causes Jenkins to ignore the trigger.
5fill in blank
hard

Fill all three blanks to define environment variables and use them in a Jenkins pipeline.

Jenkins
pipeline {
  agent any
  environment {
    [1] = '[2]'
  }
  stages {
    stage('Print') {
      steps {
        echo "Value is: $[3]"
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
AMY_VAR
Bhello_world
DVALUE
Attempts:
3 left
💡 Hint
Common Mistakes
Using different names for variable definition and usage.
Forgetting to quote the value string.