Independence Day Deal! Unlock 25% OFF Today – Limited-Time Offer - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

CloudBees Exam CJE Topic 2 Question 100 Discussion

Actual exam question for CloudBees's CJE exam
Question #: 100
Topic #: 2
[All CJE Questions]

You have a stage called "Promote to Green," and you only want to run it when "development" is the current branch in a multibranch pipeline. How would you use the "when" declarative to accomplish this?

Show Suggested Answer Hide Answer
Suggested Answer: D

Authorization and authentication are different but related concepts. They don't vary or indicate a level of strictness.


Contribute your Thoughts:

Latrice
28 days ago
I wonder if they have a 'Promote to Chartreuse' stage as well. Or maybe a 'Demote to Mauve' option for those special occasions.
upvoted 0 times
...
Vallie
30 days ago
Option D is just a bit too simple, don't you think? 'when 'development'' doesn't really give us the control we need. I'll stick with Option A for this one.
upvoted 0 times
Val
4 days ago
Using 'when { branch 'development' }' gives us the control we need.
upvoted 0 times
...
Felix
14 days ago
I think Option A is the best choice here.
upvoted 0 times
...
Micaela
16 days ago
I agree, Option D is too simple.
upvoted 0 times
...
...
Toi
2 months ago
Ooh, Option C is interesting. Using a script-style condition with a variable is a bit more advanced. But I think Option A is the cleaner, more declarative solution.
upvoted 0 times
Nathalie
18 days ago
User 3: I agree, Option A is more declarative and easier to understand.
upvoted 0 times
...
Lynda
24 days ago
User 2: Yeah, using 'branch' to specify the condition seems cleaner.
upvoted 0 times
...
Veronica
1 months ago
User 1: I think Option A is the way to go.
upvoted 0 times
...
...
Chu
2 months ago
Hmm, Option B is a bit off the mark. Checking for the 'master' branch when we want 'development' seems like a mistake. I'd steer clear of that one.
upvoted 0 times
...
Mona
2 months ago
Ah, the classic 'Promote to Green' question. Option A looks like the winner to me - using the 'branch' declarative to check for the 'development' branch. Nice and straightforward!
upvoted 0 times
Tamar
29 days ago
User 2: Yeah, that seems like the most logical choice. Let's go with that.
upvoted 0 times
...
Ronny
1 months ago
User 1: I think option A is the way to go, checking for the 'development' branch.
upvoted 0 times
...
...
Owen
2 months ago
I'm not sure, but I think C) when( $branch == 'development') could also work if you define the variable 'branch' correctly in the pipeline script.
upvoted 0 times
...
Andrew
2 months ago
I agree with Mabelle. Using branch condition in the 'when' declarative is the right way to ensure the stage runs only on the 'development' branch.
upvoted 0 times
...
Mabelle
2 months ago
I think the correct answer is A) when { branch 'development' } because it specifies the branch condition.
upvoted 0 times
...

Save Cancel
az-700  pass4success  az-104  200-301  200-201  cissp  350-401  350-201  350-501  350-601  350-801  350-901  az-720  az-305  pl-300  

Warning: Cannot modify header information - headers already sent by (output started at /pass.php:70) in /pass.php on line 77