Manage application.conf in several environments
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的更多相关文章
- [Python] Manage Dependencies with Python Virtual Environments
Virtual Environments ensure that dependencies from one Python application don’t overwrite the depend ...
- [Javascript] Manage Application State with Immutable.js
Learn how Immutable.js data structures are different from native iterable Javascript data types and ...
- [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’ ...
- Put your application in production
Here some simple tips to optimize your application for production. Configure your application.conf F ...
- Test your application
Creating automatic test suites for your application is a good way to make it robust. It allows you t ...
- Spring Boot Reference Guide
Spring Boot Reference Guide Authors Phillip Webb, Dave Syer, Josh Long, Stéphane Nicoll, Rob Winch, ...
- Spring Boot文档
本文来自于springboot官方文档 地址:https://docs.spring.io/spring-boot/docs/current/reference/html/ Spring Boot参考 ...
- Deployment options
Play applications can be deployed virtually anywhere: inside Servlet containers, as standalone serve ...
- Logging configuration
The Play logger is built on Log4j. Since most Java libraries use Log4j or a wrapper able to use Log4 ...
随机推荐
- ClickOnce部署(4):下载多个安装包
有时候,我们可能会一次性发布多个安装包,当然在网页上多加几个链接让用户逐个安装也是可取的.不过,也可以弄得更方便些,即用户先安装一个,作为一个"引导程序",然后通过这个程序去下载安 ...
- python利用dict模拟switch
pytho本身并未提供switch语句,但可以通过dict来模拟switch, #方法1 def add(x,y): return x+y def dec(x,y): return x-y def m ...
- SubSonic3.0.0.4.3源码包与调用Dll
版本修改历史 3.0.0.4.3版修复了下面问题: 修正多表关联查询时,使用左关联和右关联出错问题修正DbDataProvider.cs类的ToEnumerable函数打开数据库链接后没有关闭的问题添 ...
- MySQL密码忘记,怎么办?
如果哪天你忘记了线上MySQL数据库的root密码,怎么办? 大家往往会想到skip-grant-tables参数,具体步骤如下: 1. 关闭MySQL数据库,因为root密码忘记了,mysqladm ...
- CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.
今天,在用icinga服务器端测试客户端脚本时,报如下错误: [root@mysql-server1 etc]# /usr/local/icinga/libexec/check_nrpe -H 192 ...
- JavaScript使用构造函数获取变量的类型名
在JavaScript中,如何准确获取变量的类型名是一个经常使用的问题. 但是常常不能获取到变量的精确名称,或者必须使用jQuery 中的方法,这里 我通过 typeof ,jQuery.type 和 ...
- DEBIAN下中文显示
转:http://www.cppblog.com/colorful/archive/2012/05/28/176516.aspx 一.首先检查LOCALE情况 说明:DEBIAN因为基于GNU所以,对 ...
- iOS_常用C语言函数
一.随机数: 1.rand(); 范围: 0-无穷大. 特点: 仅第一次随机,其他次都是和第一次相同.常用于调试. 返回值: long 实例: int ...
- (五)WebGIS中通过行列号来换算出多种瓦片的URL 之在线地图
文章版权由作者李晓晖和博客园共有,若转载请于明显处标明出处:http://www.cnblogs.com/naaoveGIS/. 1.前言 这篇文章里,我主要针对OGC标准中的WMS.WMTS以及Ar ...
- Android Studio获取SHA1和MD5方法
1,点击Build > Generate Signed APK. 2,打开命令进入C:\Program Files\Java\jdk1.6.0_39\bin(任何已安装的Java目录) 3,键入 ...