Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

LPI Exam 701-100 Topic 8 Question 42 Discussion

Actual exam question for LPI's 701-100 exam
Question #: 42
Topic #: 8
[All 701-100 Questions]

A declarative Jenkins pipeline contains the following excerpt:

parameters {

string (name: 'TargetEnvironment', defaultValue: 'staging', description: 'Target environment')

}

How can a task use the value provided for TargetEnvironment?

Show Suggested Answer Hide Answer
Suggested Answer: E

Contribute your Thoughts:

Virgina
25 days ago
Option E is clearly the answer - $ENV{TargetEnvironment} is the way to go, because everyone knows Jenkins pipelines are just glorified shell scripts, right? Right??
upvoted 0 times
Judy
8 hours ago
B) $TargetEnvironment
upvoted 0 times
...
Louisa
8 days ago
A) {{TargetEnvironment}}
upvoted 0 times
...
...
Marguerita
26 days ago
I'm just going to go with D and hope the exam gods smile upon me. Though, I have to admit, option E with the $ENV{TargetEnvironment} looks like it could be from a Perl script. This exam is getting confusing!
upvoted 0 times
...
Ryan
28 days ago
Haha, option C with the %TargetEnvironment% looks like something from a Windows batch script. This is definitely a Jenkins pipeline, so D is the right answer.
upvoted 0 times
Leota
1 days ago
Option D) ${params.TargetEnvironment} is the correct way to use the value provided for TargetEnvironment.
upvoted 0 times
...
...
Deandrea
2 months ago
I was tempted to go with option B, but that's more of a shell variable syntax. The Jenkins pipeline syntax uses the params object, so D is the way to go.
upvoted 0 times
Joye
7 days ago
Good to know, thanks for clarifying!
upvoted 0 times
...
Kayleigh
10 days ago
Yes, you're right. The params object is used in Jenkins pipeline syntax.
upvoted 0 times
...
Leota
23 days ago
I think D) ${params.TargetEnvironment} is the correct way to access the value.
upvoted 0 times
...
...
Asuncion
2 months ago
I think option D is correct, as it uses the params object to access the TargetEnvironment parameter.
upvoted 0 times
Corrina
11 days ago
Yes, you are right. Option D is the correct way to use the value provided for TargetEnvironment.
upvoted 0 times
...
Theola
1 months ago
D) ${params.TargetEnvironment}
upvoted 0 times
...
Eileen
1 months ago
I believe option D is correct, it accesses the TargetEnvironment parameter using the params object.
upvoted 0 times
...
Tiera
1 months ago
A) {{TargetEnvironment}}
upvoted 0 times
...
...
Erinn
2 months ago
I'm not sure, but I think it might be E) $ENV{TargetEnvironment}
upvoted 0 times
...
Shawnee
2 months ago
I agree with Raina, D) ${params.TargetEnvironment} makes sense because it references the parameter value
upvoted 0 times
...
Raina
2 months ago
I think the correct answer is D) ${params.TargetEnvironment}
upvoted 0 times
...

Save Cancel