Question

I have setup Jenkins for my Play! 2.1

I have setup Build and Deploy jobs, they work well. But I seem to cannot figure out how to deploy and run Play! from Jenkins to EC2.

For example, I used this command play dist to pack everything into a zip file in Build job and copy the artefact over to Deploy job. Then use scp to upload to EC2 via Publish-Over-SSH plugin, which works fine. Now, If I want Jenkins to run the App immediately, I will unzip the file and run sh start command. That would run the application run up but Play! wouldn't release the console so Jenkins job would never finish. So, how do I run Play! 2.1 and release the console so Jenkins can finish the job and how do I kill the old application if a new commit has come in? So, the process will keep going.

Was it helpful?

Solution

Use the nohup command combined with the & char.

nohup ./start.sh & 

That should run the process on background and not kill the application when you logout.

NB : You might have to install nohup.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top