2
votes

I Have a deployment script which at run time asks for confirmation to proceed further for deployment and password. I have used publish-over-ssh plugin with jenkins to run my build and deployment script on target server. But As deployment Shell script is Interactive it takes user inputs at run time and in jenkins the build is going in hang status. Is there any way I can setup jenkins configuration for depolyment script to run on target unix server and at run time jenkins should prompt me for user confirmation and password. Please suggest.

Thanks in Advance.

2

2 Answers

0
votes

Jenkins doesn't support interactive scripts. Just pass the confirmation on standard input, for example:

yes | ./my_script.sh

For user names and passwords it's better (security and complexity-wise) to use the SSH Agent Plugin.

Making such a script interactive is anyway not the *nix way. If possible I would highly recommend changing it to take all the parameters it needs to run without any interaction. Then you can simply do this:

./my_script.sh --option-name=option-value [...] parameter-value [...]
0
votes

Commented the interactions which were not necessary and for Password prompt set Public Key authentication through key gen process.