Reputation: 1706
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:
Upvotes: 1
Views: 1691
Reputation: 307
For Windows: make task with type "Script" and interperter "Windows PowerShell". In script body type "Start-Process ". It works 100%.
Upvotes: 1
Reputation: 11
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
Upvotes: 1
Reputation: 4556
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>} "
Upvotes: 1
Reputation: 10404
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 &
Upvotes: 1