confirming the build before starting

26 views
Skip to first unread message

niraj nandane

unread,
Nov 12, 2014, 5:44:04 AM11/12/14
to jenkins...@googlegroups.com
Hi,
I have a parameterized build which accept string as parameter . I want to show user a message "empty string" in the form of alert box or simply showing "Not entered anything.Do you want to continue> with continue button below" if he click on build button without entering string in text box. If he enters the string then i will start my build . How i can achieve this ?
Any help would be greatly appreciated

Felix Nawroth

unread,
Nov 12, 2014, 7:17:07 AM11/12/14
to jenkins...@googlegroups.com
Hi,

I don't think this can be easily done. You would need a parameter plugin that runs a validator on its text field, and the validator would have to write Javascript to its error message area.

A build run itself is not meant to be inveractive, you can't pause it to query for some kind of user confirmation or any other interaction. So once the build is running you've got to work with what you've got.

The only approach I can think of: Preset a default value like "CHANGE_ME" for you text field and use flashy HTML markup in the parameter description to tell your users to really change the field content.

As first build step of your job run a shell or batch step that makes sure that your parameter is different from "CHANGE_ME". Here's what I use to protect a deployment job from accidental triggering, with a checkbox parameter for the job:

if ! [[ "${CONFIRM_THE_DEPLOYMENT}" == true ]]
then
  echo "Please confirm your deployment order by setting the checkbox!";echo "________________________"; exit 22
fi

I generally like the idea - some kind of validated parameter plugin than only enables the build button if all parameters are in their expected ranges, not empty etc. But then again this really is something you would expect your users to take care of themselves. Just make sure to catch all input that might cause damage.

Regards,
Felix


Von: jenkins...@googlegroups.com [jenkins...@googlegroups.com]" im Auftrag von "niraj nandane [niraj....@gmail.com]
Gesendet: Mittwoch, 12. November 2014 11:44
An: jenkins...@googlegroups.com
Betreff: confirming the build before starting

Hi,
I have a parameterized build which accept string as parameter . I want to show user a message "empty string" in the form of alert box or simply showing "Not entered anything.Do you want to continue> with continue button below" if he click on build button without entering string in text box. If he enters the string then i will start my build . How i can achieve this ?
Any help would be greatly appreciated

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

niraj nandane

unread,
Nov 12, 2014, 7:26:07 AM11/12/14
to jenkins...@googlegroups.com
Hi,
I got one of the stackoverflow link which is doing exactly what i want. But it is not working in my env.Could you please figure out this?


--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-users/wE0j_zojMQY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-use...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Thanks and regards--
Niraj Nandane(Vit pune)

niraj nandane

unread,
Nov 12, 2014, 7:27:47 AM11/12/14
to jenkins...@googlegroups.com, f.na...@bigpoint.net
Hi,
I got one of the stackoverflow link which is doing exactly what i want. But it is not working in my env.Could you please figure out this?


Craig Phillips

unread,
Nov 12, 2014, 8:37:45 AM11/12/14
to jenkins...@googlegroups.com
What exactly didn't work about the solution you got from stack overflow?

Are you creating a custom web service for submitting the builds from, or perhaps hosting an HTML page on the Jenkins server for this?
 

niraj nandane

unread,
Nov 12, 2014, 11:46:57 AM11/12/14
to jenkins...@googlegroups.com

Could you please post a code to add continue button only ?

On Nov 12, 2014 7:07 PM, "Craig Phillips" <iwonb...@gmail.com> wrote:
What exactly didn't work about the solution you got from stack overflow?

Are you creating a custom web service for submitting the builds from, or perhaps hosting an HTML page on the Jenkins server for this?
 

--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-users/wE0j_zojMQY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-use...@googlegroups.com.

niraj nandane

unread,
Nov 12, 2014, 11:48:22 AM11/12/14
to jenkins...@googlegroups.com

Or some link which will decribe what is there did on posted stack overflow link ?

Reply all
Reply to author
Forward
0 new messages