0
0
Jenkinsdevops~10 mins

String, boolean, and choice parameters 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 define a string parameter named 'ENV'.

Jenkins
parameters {
    string(name: 'ENV', defaultValue: 'dev', description: [1])
}
Drag options to blanks, or click blank then click option'
A['dev', 'prod']
Btrue
C'Environment to deploy to'
Dfalse
Attempts:
3 left
💡 Hint
Common Mistakes
Using boolean values instead of a description string.
Using a list instead of a string for description.
2fill in blank
medium

Complete the code to define a boolean parameter named 'DEBUG_MODE'.

Jenkins
parameters {
    booleanParam(name: 'DEBUG_MODE', defaultValue: [1], description: 'Enable debug mode')
}
Drag options to blanks, or click blank then click option'
A'true'
Btrue
Cfalse
D'false'
Attempts:
3 left
💡 Hint
Common Mistakes
Using strings 'true' or 'false' instead of boolean values.
Leaving the defaultValue empty.
3fill in blank
hard

Fix the error in the choice parameter definition by completing the 'choices' field.

Jenkins
parameters {
    choice(name: 'REGION', choices: [1], description: 'Select deployment region')
}
Drag options to blanks, or click blank then click option'
A'us-east-1\nus-west-2\neu-central-1'
B['us-east-1', 'us-west-2', 'eu-central-1']
Cus-east-1, us-west-2, eu-central-1
D'us-east-1, us-west-2, eu-central-1'
Attempts:
3 left
💡 Hint
Common Mistakes
Using a list instead of a newline-separated string.
Using commas inside the string instead of newlines.
4fill in blank
hard

Fill both blanks to define a string parameter with a default value and description.

Jenkins
parameters {
    string(name: 'VERSION', defaultValue: [1], description: [2])
}
Drag options to blanks, or click blank then click option'
A'1.0.0'
Btrue
C'Application version to deploy'
Dfalse
Attempts:
3 left
💡 Hint
Common Mistakes
Using boolean values instead of strings.
Mixing up defaultValue and description.
5fill in blank
hard

Fill all three blanks to define a choice parameter with a name, choices, and description.

Jenkins
parameters {
    choice(name: [1], choices: [2], description: [3])
}
Drag options to blanks, or click blank then click option'
A'ENVIRONMENT'
B'dev\nstaging\nprod'
C'Deployment environment'
D'VERSION'
Attempts:
3 left
💡 Hint
Common Mistakes
Using lists for choices instead of newline-separated strings.
Using wrong strings for name or description.