0
votes

I'm using Jenkins to deploy my play application for this I've added SSH support to jenkins and I connect via ssh to the test server and then I run a shel script via ssh.

Thats working fine.

Not working ist finishing the job in jenkins.

The command in the the shell script is the following:

/usr/src/activator-dist-1.3.10/bin/activator "~ run" &

that only should run the activator, build and run the project

But then when The application is build and the activator runs the Jenkins job dosn't finish ... it always hang in console

looks like this: enter image description here

1

1 Answers

2
votes

When you run a script via ssh it will stay open until stdout/stderr are closed or a timeout occurs. In Jenkins it seems as if the script hangs. So if you run a script as background job, make sure to redirect all its output to somewhere:

nohup yourCommand < /dev/null > /dev/null 2>&1 &

or

nohup yourCommand < /dev/null >> logfile.log 2>&1 &

See SSH Frequently Asked Questions for more details.