5

I am aware of at least two local options to deploy Play apps, this is, either copying the whole thing and running play start, or exporting a war to run it as part of another app server.

I've also used the deploy mechanisms for gae and heroku. Very neat.

However, what I want to do is:

  • deploy locally to my servers (there will be a bunch of them that receive the same copy, behind a load balancer).
  • run just play with netty, so no war into tomcat/jboss/you name it
  • do NOT deploy the source code, git files, etc.... Just the mimimum necessary (precompiled, config, templates I guess, public dir, ...)

Is there a command or option that I've missed in play to do this? Maybe exporting a war and running it from a different play server, if that makes sense? Or am I going to find out what is needed and not after a precompile and copy over only that?

EDIT:

The accepted answer is what I was looking for, but is not available on 1.2.x. Eventually I created my own script, where the most important bits are:

  1. run play precompile
  2. Copy the conf/, precompiled/, public/, lib/ and app/views/ directories to the location where you want to deploy (my script does a tar.gz of that and uncompresses it there).
  3. run play start -Dprecompiled=true
palako
  • 3,129
  • 2
  • 21
  • 32

2 Answers2

3

This is for Play 2, not Play 1.

Run play dist to generate a zip that you can copy anywhere and run. More details...

James Ward
  • 28,966
  • 9
  • 47
  • 79
0

You can either deploy with the sources or as a war.

The most convenient way to deploy is to just fetch it from your vcs. See Best deployment strategy for PlayFramework applications? , answer of cdegroot for a discussion of that strategy.

Community
  • 1
  • 1
Samuel
  • 1,629
  • 12
  • 18