Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How Does Jenkins Deal With Interactive Shell Scripts?

I am writing a couple Linux shell scripts that move some code around and it would be nice and simple if these could be interactive.

The drawback is I would like to execute some of these scripts in Jenkins and am not entirely sure of how Jenkins handles user prompts within the script. I haven't been able to find much of anything on this and don't have the resources to just go ahead and test it, so any advice would be appreciated.

Thanks guys

like image 338
degausser Avatar asked Jul 26 '12 16:07

degausser


1 Answers

If a command that Jenkins executes expects input, it will just sit there and wait for the input. The job will hang and you'll need to kill it manually. One way of coping with this is to pipe the expected input into the command, e.g.

echo "input" | command

or

command < file_with_input
like image 148
Lars Kotthoff Avatar answered Sep 18 '22 15:09

Lars Kotthoff