From 3c88d798ad3e19c321685fa633e0c0924dd34181 Mon Sep 17 00:00:00 2001 From: Artem Pyanykh Date: Sun, 30 Nov 2014 15:21:05 +0300 Subject: [PATCH 1/2] Add documentation about Play 2 packaging as deb- and rpm-packages --- src/sphinx/DetailedTopics/index.rst | 1 + src/sphinx/DetailedTopics/play.rst | 45 +++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 src/sphinx/DetailedTopics/play.rst diff --git a/src/sphinx/DetailedTopics/index.rst b/src/sphinx/DetailedTopics/index.rst index 90ed1d897..5dffb878e 100644 --- a/src/sphinx/DetailedTopics/index.rst +++ b/src/sphinx/DetailedTopics/index.rst @@ -15,3 +15,4 @@ Advanced Topics docker.rst paths.rst custom.rst + play.rst diff --git a/src/sphinx/DetailedTopics/play.rst b/src/sphinx/DetailedTopics/play.rst new file mode 100644 index 000000000..7989cd07b --- /dev/null +++ b/src/sphinx/DetailedTopics/play.rst @@ -0,0 +1,45 @@ +Play 2 Packaging +================ + +Although Play 2 supports Sbt Native Packager, it requires some additional steps +to successfully package and run your application. + +Build Configuration +------------------- + +Depending on whether you want to package your application as a deb-package or +as an rpm-package, you have to setup your build configuration accordingly. +Please, refer to :doc:`Debian ` and :doc:`Redhat ` +pages for additional information. + +It is important to mention that you may have certain difficulties with **Upstart** +service manager (i.e. inability to create necessary folders after system restart), +so it is advised to use **SystemV** service manager instead. +For more information on service managers please refer +to :doc:`Getting Started With Servers ` page. + +Application Configuration +------------------------- + +In order to run your application in production you need to provide it with at least: + +* Location where it can store its pidfile +* Production configuration + +One way to provide this information is create ``src/templates/etc-default`` with the following contents: + +.. code-block:: bash + + # Since play uses separate pidfile we have to provide it with a proper path + -Dpidfile.path=/var/run/${{app_name}}/play.pid + + # Use separate configuration file for production environment + -Dconfig.file=/usr/share/${{app_name}}/conf/production.conf + + # You may also want to include this setting if you use play evolutions + -DapplyEvolutions.default=true + +This way you should either store your production configuration under ``${{path_to_app_name}}/conf/production.conf`` +or put it under ``/usr/share/${{app_name}}/conf/production.conf`` by hand or using some configuration management system. + +See :doc:`adding configuration ` for more information on `etc-default` template. \ No newline at end of file From 8ef2efb606e326961b8e2ac227adaeefc5f63b53 Mon Sep 17 00:00:00 2001 From: Artem Pyanykh Date: Wed, 3 Dec 2014 10:42:46 +0300 Subject: [PATCH 2/2] Make section about upstart sound more positive --- src/sphinx/DetailedTopics/play.rst | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/sphinx/DetailedTopics/play.rst b/src/sphinx/DetailedTopics/play.rst index 7989cd07b..30fdee127 100644 --- a/src/sphinx/DetailedTopics/play.rst +++ b/src/sphinx/DetailedTopics/play.rst @@ -12,9 +12,8 @@ as an rpm-package, you have to setup your build configuration accordingly. Please, refer to :doc:`Debian ` and :doc:`Redhat ` pages for additional information. -It is important to mention that you may have certain difficulties with **Upstart** -service manager (i.e. inability to create necessary folders after system restart), -so it is advised to use **SystemV** service manager instead. +Note that **Upstart** is not supported by all available operation systems and may not always work as expected. +You can always fallback to the **SystemV** service manager instead. For more information on service managers please refer to :doc:`Getting Started With Servers ` page.