javawindowsdeploymentplayframework-2.0bamboo

How to start Play using Bamboo without having the deployment continue forever?


We have created a Play application in Java and are deploying it to a dev-environment virtual machine using Atlassian Bamboo's SSH task: cd path/to/application/directory && start "" play run. This goes to the proper location, launches a new console, and starts play: the server is started successfully and we can access the site with no issues.

The problem is that the deployment task in Bamboo never stops because it is still monitoring the console where play run was called -- in the Bamboo status, we are seeing things like Deploying for 7,565 minutes. We thought adding the start "" would fix that issue, but in Bamboo it is the same as just doing the play run. Also, when we need to redeploy, we must first stop the deployment in process, and manually relaunch it.

Two questions:

  1. How can we start the server from Bamboo in such a way that the deployment plan finishes?
  2. How can we stop/kill the previous server from Bamboo at the beginning of the next deployment?

Solution

  • Bamboo is pretty bad for background tasks. Had a similar problem, eventually, we wrote a bash script that was run in background.

    start.sh &1> /dev/null &2 > /dev/null &