|
| 1 | +Adding configuration |
| 2 | +#################### |
| 3 | + |
| 4 | +After :doc:`creating a package <MyFirstProject>`, the very next thing needed, usually, is the ability for users/ops to customize the application once it's deployed. Let's add some configuration to the newly deployed application. |
| 5 | + |
| 6 | +There are generally two types of configurations: |
| 7 | + |
| 8 | +* Configuring the JVM and the process |
| 9 | +* Configuring the Application itself. |
| 10 | + |
| 11 | +The server archetype provides you with a special feature to configure your application |
| 12 | +with a single file. As this file is OS dependend, each OS gets section. |
| 13 | + |
| 14 | +Linux |
| 15 | +***** |
| 16 | + |
| 17 | +Create ``src/templates/etc-default`` with the following template |
| 18 | + |
| 19 | +.. code-block :: bash |
| 20 | +
|
| 21 | + # Available replacements |
| 22 | + # ------------------------------------------------ |
| 23 | + # ${{author}} debian author |
| 24 | + # ${{descr}} debian package description |
| 25 | + # ${{exec}} startup script name |
| 26 | + # ${{chdir}} app directory |
| 27 | + # ${{retries}} retries for startup |
| 28 | + # ${{retryTimeout}} retry timeout |
| 29 | + # ${{app_name}} normalized app name |
| 30 | + # ${{daemon_user}} daemon user |
| 31 | + # ------------------------------------------------- |
| 32 | +
|
| 33 | + # Setting -Xmx and -Xms in Megabyte |
| 34 | + # -mem 1024 |
| 35 | +
|
| 36 | + # Setting -X directly (-J is stripped) |
| 37 | + # -J-X |
| 38 | + # -J-Xmx1024 |
| 39 | +
|
| 40 | + # Add additional jvm parameters |
| 41 | + # -Dkey=val |
| 42 | +
|
| 43 | + # For play applications you may set |
| 44 | + # -Dpidfile.path=/var/run/${{app_name}}/play.pid |
| 45 | +
|
| 46 | + # Turn on JVM debugging, open at the given port |
| 47 | + # -jvm-debug <port> |
| 48 | +
|
| 49 | + # Don't run the java version check |
| 50 | + # -no-version-check |
| 51 | + |
| 52 | + # enabling debug and sending -d as app argument |
| 53 | + # the '--' prevents app-parameter swalloing when |
| 54 | + # using a reserved parameter. See #184 |
| 55 | + # -d -- -d |
| 56 | +
|
| 57 | +The file will be installed to ``/etc/default/<normalizedName>`` and read from there |
| 58 | +by the startscript. |
| 59 | + |
| 60 | +Environment variables |
| 61 | +===================== |
| 62 | + |
| 63 | +The usual ``JAVA_OPTS`` can be used to override settings. This is a nice way to test |
| 64 | +different jvm settings with just restarting the jvm. |
| 65 | + |
| 66 | +Windows |
| 67 | +***** |
| 68 | + |
| 69 | +Support planned for 0.8.0 |
| 70 | + |
| 71 | +Example Configurations |
| 72 | +###################### |
| 73 | + |
| 74 | +A list of very small configuration settings can be found at `sbt-native-packager-examples`_ |
| 75 | + |
| 76 | + .. _sbt-native-packager-examples: https://github.com/muuki88/sbt-native-packager-examples |
| 77 | + |
| 78 | +Next, let's :doc:`how to override start templates <OverrdingTemplates>`. |
0 commit comments