1
votes

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?
3

3 Answers

0
votes

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 &
0
votes

not at all familiar with WAMP stack or the play cli, but try running it as a powershell command, which should run in and exit immediately

powershell -command "& <your command here>"

or failing that

powershell -command "& start-job { <your command here>} "
0
votes

For Windows you can run background tasks using Groovy script. Groovy can execute an external program as an process:

"/bin/application.exe".execute()

And then you can check that application is running:

println "tasklist /fi \"imagename eq application.exe\"".execute().text