2.5.x
Java
Ubuntu 15.10
Oracle 1.8.0_72
The configuration parameters given in the application.conf is loaded from the environment variables as documented here: https://www.google.com/url?q=https%3A%2F%2Fwww.playframework.com%2Fdocumentation%2F2.5.x%2FProductionConfiguration&sa=D&sntz=1&usg=AFQjCNFhDiYsiRReBQBHZNL6Pzs_jGnkVQ
Distributable created from 'activator clean compile dist'
We have posted this in google groups(https://groups.google.com/forum/#!topic/play-framework/9THTrrw6YO8) and stack-overflow, but have not received any answers so far.
I ran a quick test using our play-scala example to attempt to confirm this:
I modified application.conf to contain:
play.crypto.secret = ${?PLAY_SECRET}
(so I know the app will fail to start if the environment variable is not defined)
sbt dist
unzip target/universal/play-scala-1.0-SNAPSHOT.zip
cd play-scala-1.0-SNAPSHOT/bin
./play-scala # produces configuration error as expected
PLAY_SECRET=foobar ./play-scala # works fine
So I'm unable to reproduce. I suspect you're just not setting the environment variable properly.
@gmethvin I am setting environment variables through source command in shell. When I echo the variable( example: echo $PLAY_SECRET) in the shell, I am seeing the correct value.
Can you let me know how you are setting environment variable? I will share my sample soon.
@Technowise You can export
export PLAY_SECRET=foobar
./play-scala
or set the environment variable for just one command:
PLAY_SECRET=foobar ./play-scala
I know bash and zsh support those syntaxes, and csh uses setenv. You'll have to check that you're using the correct syntax for whichever shell you use.
Most helpful comment
I ran a quick test using our play-scala example to attempt to confirm this:
I modified
application.confto contain:(so I know the app will fail to start if the environment variable is not defined)
So I'm unable to reproduce. I suspect you're just not setting the environment variable properly.