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. Android-Notification-简单的demo

    通知,几乎存在于每一个 Android 的应用中,新闻客户端来一条新闻的时候会给你发一条通知,QQ.微信有新消息来的时候会给你发一条通知,反正,通知就像魔鬼般一直缠绕在我们的左右.所以,Android ...

  2. Android开发-之SQLite数据库

    之前我们讲了如何将数据存储在文件中,那么除了这种方式呢,就是我们常见的大家都知道的将数据存储在数据库当中了. 将数据存储在数据库中的优势: 1)存储在数据库中的数据更加方便操作,比如增.删.改.查等 ...

  3. jQuery第二篇 (帅哥)

    1.1 jQuery操作DOM jQuery课程的目标:学会使用jQuery设计常见效果 选择器 基本选择器:#id ..class .element.* . 层级选择器: 空格.>.+.~ 基 ...

  4. Textbox.Visible=False隐藏方式导致的问题

    今天公司的正式环境有个功能不好使,但是测试环境没有问题,经过和同事的研讨,发现应该是我在写代码的时候把Textbox的visible属性设置为false导致的. 当时的需求是需要在发邮件的时候加上“相 ...

  5. 静态Include和动态Include测试并总结

    主要代码 hjzgg.css .center-div{ width:auto; margin-left: 40%; margin-right: 40%; display: block; positio ...

  6. Python补充06 Python之道

    作者:Vamei 出处:http://www.cnblogs.com/vamei 欢迎转载,也请保留这段声明.谢谢! Python有一个彩蛋,用下面语句调出: import this 该彩蛋的文档记录 ...

  7. iOS 7 tabbar 透明的问题

    在某种特定情景中,ios的tabbar会出现完全透明的情况,出现这种情况的原因是ios7 默认的view因为IOS7默认是全延伸,也就是说controller是延伸到tabbar下面,并且在windo ...

  8. (十八)WebGIS中清空功能和地图定位功能的设计以及实现

    文章版权由作者李晓晖和博客园共有,若转载请于明显处标明出处:http://www.cnblogs.com/naaoveGIS/. 1.背景 当地图中增加了很多元素后,对不同的元素需要进行一定的控制,最 ...

  9. 微信小程序探究

    前段时间比较流行的微信小程序,因为一直没有所谓内测码也没具体关注.拖到现在正好借组内分享的时机来仔细了解一下微信小程序.了解一个新的事物无外乎从是什么(本质),怎么用(具体用法),为什么用(优缺点)来 ...

  10. CloudNotes云端个人笔记系统系列文章汇总

    [CloudNotes版本更新信息与下载地址:http://cloudnotes.cloudapp.net/webapi/Home/Release] [CloudNotes RESTful API帮助 ...