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 ...
随机推荐
- Jenkins的Windows Slave分布式构建和部署
1.新建的Slave:系统管理-->管理节点-->新建节点 远程工作目录 即是 节点服务器 站点文件存放目录 在配置节点时 启动方法 配置的选项中的 Launch agent via Ja ...
- 通知:逆天异常库 V1.0版本支持下载了~~
百度网盘:http://pan.baidu.com/s/1bongheJ GitHub:https://github.com/dunitian/LoTDotNet
- ASP.NET MVC5 网站开发实践 - 概述
前段时间一直在用MVC4写个网站开发的demo,由于刚开始学所有的代码都写在一个项目中,越写越混乱,到后来有些代码自己都理不清了.1月26日晚上在群里跟@怒放 他们讨论这个问题,结论是即使只是一个小d ...
- 基于X86平台的PC机通过网络发送一个int(32位)整数的字节顺序
1.字节顺序 字节顺序是指占内存多于一个字节类型的数据在内存中的存放顺序,通常有小端.大端两种字节顺序.小端字节序指低字节数据存放在内存低地址处,高字节数据存放在内存高地址处:大端字节序是高字节数据存 ...
- DOM-Node类型
DOM(文档队形模型)是针对HTML和XML文档的一个API(应用程序编程接口).DOM描绘了一个层次化的节点树,允许开发人员添加,移除和修改页面的一部分.DOM可以讲任何HTML和XML文档描绘成一 ...
- (转)对Lucene PhraseQuery的slop的理解
所谓PhraseQuery,就是通过短语来检索,比如我想查"big car"这个短语,那么如果待匹配的document的指定项里包含了"big car"这个短语 ...
- 分享一个 @user 前端插件
开源地址:https://github.com/yuezhongxin/Mention.js 插件效果:类似于微博或 github 中 @user 列表效果. 这是个二次开发的插件,花了几天时间,对 ...
- 自己使用的一个.NET轻量开发结构
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIgAAABFCAIAAAAerjlvAAAE2UlEQVR4nO2a3U/bVhiH+bdyPaqpmx
- C++继承和多态
继承 访问控制 基类的成员函数可以有public.protected.private三种访问属性. 类的继承方式有public.protected.private三种. 公有继承 当类的继承方式为pu ...
- struts2学习笔记--动手搭建环境+第一个helloworld项目
在Myeclipse中已经内置好了struts2的环境,但是为了更好的理解,这里自己从头搭建一下: 前期准备:下载struts2的完整包,下载地址:https://struts.apache.org/ ...