Best practices for deploying patches in the Play Framework

When I'm in development, I launch the Play console locally with the command:

play ~run 

When I change something in the code, the system immediately recompiles the code. So far so good.

I have deployed several test servers. What I did was install the game on the servers, and then copy the entire project structure using GIT. Then I started the servers with the following command:

 play start 

And the last step is to press CTRL-D to leave the console and keep the server in the background.

Yesterday I needed to apply a couple of corrections. Therefore, I copied the code using GIT, but I could not find anywhere instructions on how to stop the server and recompile. How can i do this? What would be the best procedure for deploying the hotfix?

+4
source share
1 answer

In my opinion, you should never compile your application on a production server. Depending on the size of your application, the power of your server, this can take quite a while. And a long compilation time means a long deployment time, which, in my opinion, is bad.

I suggest doing the following:

  • Work locally with play run
  • CI (or locally) compiles and packs your application with play dist
  • Expand zip to create,
  • Unzip it
  • (bis) Stop the current application with:

     kill `echo RUNNING_PID` 
  • Run it with start.sh script enabled.

EDIT: As Julien said, you do not need to use kill -9 .

+3
source

Source: https://habr.com/ru/post/1488005/


All Articles