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

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:

Mona
3 hours 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
...
Owen
1 days 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
4 days 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
7 days ago
I think the correct answer is A) when { branch 'development' } because it specifies the branch condition.
upvoted 0 times
...

Save Cancel