When you work in a team, different developers will use different configuration keys in theirapplication.conf. For example, the log level, some database configuration… This generally leads to recurrent conflicts when you commit the file using your VCS.

Furthermore, different deployment environments – e.g. dev, test, staging and production – need different configurations.

The framework ID

To resolve this problem, Play allows you to give an ID to each framework installation. Use the play tool’s id command to define this ID:

play id

You can then prefix your configuration keys with the framework ID for which the configuration option is intended:

application.name=Cool app
application.mode=dev
application.log=INFO # Configuration for gbo
%gbo.application.log=DEBUG
%gbo.db=mem # Configuration for src
%scr.http.port=9500 # Production configuration
%prod.http.port=80
%prod.application.log=INFO
%prod.application.mode=prod

Setting the framework ID from the command line

You can specify the framework ID to use for a particular command directly from the command line. For example to run an application in production mode you can use:

play run --%production

with these lines defined in the application.conf file:

application.mode=dev
%production.application.mode=prod

It should be compatible with all commands using the framework ID information. The default ID is still defined using the play id command.

By the way, play test is then equivalent to:

play run --%test

Continuing the discussion

Now we shall move on to Production deployment.

Manage application.conf in several environments的更多相关文章

  1. [Python] Manage Dependencies with Python Virtual Environments

    Virtual Environments ensure that dependencies from one Python application don’t overwrite the depend ...

  2. [Javascript] Manage Application State with Immutable.js

    Learn how Immutable.js data structures are different from native iterable Javascript data types and ...

  3. [React] Use React Context to Manage Application State Through Routes

    We’ll create a Router component that will wrap our application and manage all URL related state. We’ ...

  4. Put your application in production

    Here some simple tips to optimize your application for production. Configure your application.conf F ...

  5. Test your application

    Creating automatic test suites for your application is a good way to make it robust. It allows you t ...

  6. Spring Boot Reference Guide

    Spring Boot Reference Guide Authors Phillip Webb, Dave Syer, Josh Long, Stéphane Nicoll, Rob Winch,  ...

  7. Spring Boot文档

    本文来自于springboot官方文档 地址:https://docs.spring.io/spring-boot/docs/current/reference/html/ Spring Boot参考 ...

  8. Deployment options

    Play applications can be deployed virtually anywhere: inside Servlet containers, as standalone serve ...

  9. Logging configuration

    The Play logger is built on Log4j. Since most Java libraries use Log4j or a wrapper able to use Log4 ...

随机推荐

  1. Qt 之 数字钟

    本例用来展示 QTimer 的使用,如何定时的更新一个窗口部件. 1  QLCDNumber 类 QLCDNumber 是一种可将数字显示为类似 LCD 形式的窗口部件,它同 QLabel 一样,都继 ...

  2. 《Qt Quick 4小时入门》学习笔记3

    http://edu.csdn.net/course/detail/1042/14807?auto_start=1 Qt Quick 4小时入门 第八章:Qt Quick中的锚(anchors)布局 ...

  3. android表白app

    一.前言 马上就要520和521了,是不是还有像我一样的单身狗啊.我就知道有,所以这两天简单写了这个小程序(其实是替别人写的),虽然我并不会用去骗女孩子(因为最近太忙了,实习完之后要搞毕设,要搞论文啊 ...

  4. ConcurrentDictionary线程不安全么,你难道没疑惑,你难道弄懂了么?

    前言 事情不太多时,会时不时去看项目中同事写的代码可以作个参考或者学习,个人觉得只有这样才能走的更远,抱着一副老子天下第一的态度最终只能是井底之蛙.前两篇写到关于断点传续的文章,还有一篇还未写出,后续 ...

  5. Android自定义View 画弧形,文字,并增加动画效果

    一个简单的Android自定义View的demo,画弧形,文字,开启一个多线程更新ui界面,在子线程更新ui是不允许的,但是View提供了方法,让我们来了解下吧. 1.封装一个抽象的View类   B ...

  6. Description Resource Path Location Type Error executing aapt: Return code -1073741819 Client line 1

    Logcat报错:Description    Resource    Path    Location Type Error executing aapt: Return code -1073741 ...

  7. js 对闭包的理解

    <!DOCTYPE html> <html> <body> <p>局部变量计数.</p> <button type="but ...

  8. 初识MongoDB

    1. 初识 接触MongoDB,是由于最近在工作中用到了MongoDB做数据存储.之前也听说过这个NoSQL数据库,但是一直没有尝试去使用它做开发.这次趁着这个机会,想好好学习下这个NoSQL数据库. ...

  9. ZOJ Problem Set - 1006 Do the Untwist

    今天在ZOJ上做了道很简单的题目是关于加密解密问题的,此题的关键点就在于求余的逆运算: 比如假设都是正整数 A=(B-C)%D 则 B - C = D*n + A 其中 A < D 移项 B = ...

  10. Oracle配置和使用闪回

    环境:RHEL 6.4 + Oracle 11.2.0.4 目录: 一.闪回查询 1.1 闪回查询举例 1.2 闪回版本查询举例 二.闪回事物 2.1 闪回事物查询的先决条件 2.2 闪回事物查询 三 ...