Local application.conf with Play 1.2.5?

Is it possible to use local application.conf with Play 1.2.5? Our problem is that different developers have several different settings that we don’t want to keep in version control.

Alternatives found:

  • Just changing application.conf
    • Be careful not to make changes to VCS
  • Environments: Native environment for each developer:% john,% mary (stored in VCS)
    • OK, although we would not want to keep them in version control
    • From time to time, we change those that were in the development process, → cause unnecessary changes.
  • @include: application.conf for additional configuration files

Something else?

In particular, is there a way to tell Play to use a custom file name (like "conf / application.conf.local" instead of the standard "conf / application.conf"?

+5
source share
5 answers

I just came across a Play 1.x externalconfig module that could help. It seems that we are working for our purposes. In addition, it helps to keep production passwords, etc. From VCS.

Please note that this module only works in Play Java code. Play modules implemented in Python (e.g. migrate ) will not know the external configuration. There may be problems with other Java modules that rely on onConfigurationRead().

+1
source

You can add:

%my_play_id.@include.application.conf=my_application.conf

application.conf. . my_application.conf % my_play_id . , :

%developer1.@include.application.conf=developer1_conf.conf
%developer2.@include.application.conf=developer2_conf.conf
%developer3.@include.application.conf=developer3_conf.conf
+6

! 1.2.5 , , , Play! , conf/application.conf.

+1

@include , 1.2.5.

, , :

%[user-key].[property]=[value]

play run --%[user-key] play run

+1

application.template VCS ( application.conf).

, application.conf VCS.

Thus, no one interferes with the deployment configuration and the configuration of other developers.

If you want to control the deployment configuration version, just add this to the tagged versions of your VCS

0
source

All Articles