G A
G A

Reputation: 591

Best practice to deploy fixes in Play Framework

when I am in development I run the Play console locally with the command:

play ~run

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

I have deployed a couple of testing servers. What I've done is to install play on the servers and then copied the all project structure using GIT. Then I started the servers with the following command:

play start

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

Yesterday I needed to apply a couple of fixes. So I copied the code using GIT, but I couldn't find in any place instructions on how to stop the server and recompile. How can I do that? How would it be the best procedure to deploy a fix?

Upvotes: 4

Views: 504

Answers (1)

i.am.michiel
i.am.michiel

Reputation: 10404

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 a fairly long time. And a long compile time means a long deploy time which is in my point of view, bad.

What I suggest doing is :

  1. Work locally with play run
  2. Have a CI (or locally) compiling and packaging your application with play dist
  3. Deploy your zip to production,
  4. Unzip it
  5. (bis) Stop currently running application with:

    kill `echo RUNNING_PID`
    
  6. Start it with the start.sh script included.

EDIT : As Julien stated, you don't have to use the kill -9.

Upvotes: 3

Related Questions