parameterized Hudson build issue
I have a script and I can run it using execute shell and run as even parametrized by giving argument1 and argument 2 if I disable my warning message.My warning message do you want run yes/no but how we can give yes or no once we start the parametrized build. If I say yes it should continue开发者_Python百科 if I say no it should stop.Any idea would be appreciated. Thanks Pravin
If your script is interactive, it will not work, since Hudson requires non-interactive scripts - otherwise it will just hang (there is no terminal).
What you can do is, instead of asking whether to continue, make it dependent on a variable, let's say CHOICE, so
...
if [[ "$CHOICE" == "yes" ]]
then
#do some work here
else
echo "Script ended."
fi
and put CHOICE as a choice-style parameter in Hudson. The next time you start the build, it will ask you "yes" or "no". You can also pick a default for automated builds.
It might be better to use some of the Hudson variables to indicate you are in a Hudson build (HUDSON_JOB_ID?) etc. This can be used to change the behavior of the build. I see the problem in having an interactive script for building. A build script must be running without interactions with the user.
精彩评论