Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to ask for confirmation from User before running a build in Jenkins?

Tags:

I would like to implement the following in a job : When we click on the "Build" button of a parametrized build, the user will get a prompt/popup asking if they would like to perform the build or not. If, The answer (yes/no) then the build runs - otherwise not.

Are there any pointers to relevant documentation on how to do this ? Any plugins doing anything similar I am already using the Parameterized build, I want this when we click on the Build button not prior to that, as we have a Choice parameter in the build, and I need the user always select the correct choice from the drop down. Please help, I did not get anything related to this till now. The other options are to use a Boolean parameters / choice for yes / no, I was thinking more along the lines of a popup or confirmation like before erasing a job , there is an "are you sure" prompt. Any idea how to implement that kind of confirmation message ?

like image 939
Vaibhav Avatar asked Feb 27 '14 10:02

Vaibhav


People also ask

How do I trigger a build automatically in Jenkins?

Follow the steps as mentioned below to trigger a Jenkins job automatically based on GitHub's webhook configurations: Step 1: Go to the Configuration page of the respective job and under the build trigger section, check the "GitHub hook trigger for GITScm polling" checkbox and click on the Save button.

How do you pass parameters in Jenkins pipeline?

Using build parameters, we can pass any data we want: git branch name, secret credentials, hostnames and ports, and so on. Any Jenkins job or pipeline can be parameterized. All we need to do is check the box on the General settings tab, “This project is parameterized”: Then we click the Add Parameter button.


2 Answers

Add a parameter to the build. You could just name the parameter "Are you Sure?".

like image 181
Eduardo Souza Avatar answered Sep 18 '22 12:09

Eduardo Souza


Jenkins has a conditional-buildstep plug-in designed for this. It probably has a few other dependencies, but it seems the plug-in manager automatically handles this detail.

Once installed :
• Add a select parameter to your build
• Add a condition to cancel your build or put your conditions on the specific steps you want to enable conditionnally
• profit.


Step 1 :

Build the condition definition


Step 2 :

Check the condition

°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
Here's the official page :

like image 32
Balmipour Avatar answered Sep 19 '22 12:09

Balmipour