0
0
Jenkinsdevops~10 mins

Configuring system settings in Jenkins - Interactive Practice

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

Complete the code to set the Jenkins system message.

Jenkins
jenkins.model.Jenkins.instance.setSystemMessage("[1]")
Drag options to blanks, or click blank then click option'
ABuild failed
BWelcome to Jenkins!
CNo jobs configured
DSystem is offline
Attempts:
3 left
💡 Hint
Common Mistakes
Using a message that indicates an error instead of a welcome message.
Forgetting to use quotes around the message string.
2fill in blank
medium

Complete the code to enable Jenkins security.

Jenkins
jenkins.model.Jenkins.instance.setSecurityRealm(new [1]())
Drag options to blanks, or click blank then click option'
ANoSecurityRealm
BLegacySecurityRealm
CHudsonPrivateSecurityRealm
DAnonymousSecurityRealm
Attempts:
3 left
💡 Hint
Common Mistakes
Using a security realm that disables security.
Choosing a non-existent security realm class.
3fill in blank
hard

Fix the error in the code to set the number of executors to 4.

Jenkins
jenkins.model.Jenkins.instance.setNumExecutors([1])
Drag options to blanks, or click blank then click option'
A"4"
B4.0
Cfour
D4
Attempts:
3 left
💡 Hint
Common Mistakes
Passing the number as a string.
Using a word instead of a number.
Using a decimal number.
4fill in blank
hard

Fill both blanks to configure Jenkins to use the 'admin' user and set the authorization strategy to full control.

Jenkins
jenkins.model.Jenkins.instance.setSecurityRealm(new HudsonPrivateSecurityRealm(false))
jenkins.model.Jenkins.instance.setAuthorizationStrategy(new [1]())
jenkins.model.Jenkins.instance.getSecurityRealm().createAccount("[2]", "password")
Drag options to blanks, or click blank then click option'
AFullControlOnceLoggedInAuthorizationStrategy
BLoggedInUsersCanDoAnythingAuthorizationStrategy
CMatrixAuthorizationStrategy
Dadmin
Attempts:
3 left
💡 Hint
Common Mistakes
Using an authorization strategy that requires complex matrix setup.
Not creating the user before setting permissions.
5fill in blank
hard

Fill the blanks to create a new Jenkins job named 'MyJob' of type freestyle and save it.

Jenkins
import hudson.model.FreeStyleProject
import jenkins.model.Jenkins

project = Jenkins.instance.createProject([1], "[2]")
project.save()
Drag options to blanks, or click blank then click option'
AFreeStyleProject.class
BMyJob
CFreeStyleProject
DFreestyleProject.class
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect class names or missing .class suffix.
Not providing the job name as a string.