Since all the above are partially incorrect, here is my hard wrought knowledge from the last weekend.
- Use
include "application.conf"
not include "application"
(which Akka does)
- Configs must be named
.conf
or Play will discard them silently
- You probably want
-Dconfig.file=<file>.conf
so you're not classpath dependent
- Make sure your provide the full file path (e.g.
/opt/configs/prod.conf
)
Example
Here is an example of this we run:
#prod.conf
include "application"
akka.remote.hostname = "prod.blah.com"
# Example of passing in S3 keys
s3.awsAccessKeyId="YOUR_KEY"
s3.awsSecretAccessKey="YOUR_SECRET_KEY"
And just pass it in like so:
activator -Dconfig.file=/var/lib/jenkins/jenkins.conf test
of if you fancy SBT:
sbt -Dconfig.file=/var/lib/jenkins/jenkins.conf test
Dev Environment
Also note it's easy to make a developer.conf
file as well, to keep all your passwords/local ports, and then set a .gitignore
so dev's don't accidentally check them in.