1
votes

To deploy application on linux ubuntu server I have bunch of SSH commands that i currently run using PuTTY. The server has local account serviceaccount1. In PuTTY i connect to server using serviceaccount1 and executes the following commands one by one

cd /home/serviceaccount1/cr-ml
script /dev/null
screen -S data_and_status
cd cr-ml/notebooks
source activate crml
unset XDG_RUNTIME_DIR
jupyter kernelgateway --api='kernel_gateway.notebook_http' --seed_uri='data_and_status_api.ipynb' --port 8894 --ip 0.0.0.0
...
...
and so on

Now i want automate this using Jenkins. I installed SSH plugin, configured credential using SSH Username serviceaccount1 with private key

Then created a new jenkins project and added a build step Execute shell scripts on remote host using ssh and then add all the above commands.
When i build the jenkins project, it get stuck at executing 2nd command script /dev/null i see the following console output enter image description here

1

1 Answers

0
votes

To me, it seems the culprit is the screen -S data_and_status command. Once you start a screen, I don't think you would be able to execute the subsequent commands over the SSH connection.

Alternatively, you can try using a tool like Ansible to run a bunch of commands against a remote server.