JetBrains / teamcity-deployer-plugin

Deployer plugin for TeamCity CI server
http://confluence.jetbrains.net/display/TW/Deployer+plugin
Apache License 2.0
39 stars 29 forks source link

Is there a way to pass credential while executing commands requiring sudo with SSH Exec #95

Open shampoo72 opened 7 years ago

shampoo72 commented 7 years ago

Hi,

Right now this step is just hung waiting for the password input for the sudo command -

sudo systemctl stop tomcat

Is there any way it can be passed through the runner.

nskvortsov commented 7 years ago

At the moment, the runner is not interactive: you can not send additional input on the fly. But sudo can receive password from stdin, so using command like

echo myPassword | sudo -S ls /tmp

should do the trick

shampoo72 commented 7 years ago

Thanks. Works!!!