alfongj
alfongj

Reputation: 2273

How to set framework id in a Heroku deployed Play! application

my question is simple. I want to set the play framework 'id' in my heroku deployed copy, different than the one I have locally.

To do so, I followed this reference page by running 'heroku run play id' from my local computer. However, that didn't work, as if I executed again the same command, it would tell me that the id was still empty.

So, I researched in StackOverflow a bit, and got to this page in which I understand, according to an answer, that I can do so by modifying the PLAY_OPTS variable, but I dont really get it... So if someone could explain it to me clearly, I would really appreciate it!

Thanks a lot in advance,

Pepillo

Upvotes: 2

Views: 1464

Answers (2)

Joel Grenon
Joel Grenon

Reputation: 3273

Edit your Heroku config (heroku config) and add PLAY_OPTS to your liking.

heroku config:add PLAY_OPTS="--%prod -Dprecompiled=true"

After, just change your Procfile to something like :

web: play run --http.port=$PORT $PLAY_OPTS

Upvotes: 0

James Ward
James Ward

Reputation: 29433

You can see the PLAY_OPTS environment variable with:

heroku config

Which should include:

PLAY_OPTS           => --%prod -Dprecompiled=true

You can change that with something like:

heroku config:add PLAY_OPTS="--%foo -Dprecompiled=true"

But you will have to make sure that you also tell the Play app not to try and listen on the jpda port or it will fail to start on Heroku.

Upvotes: 3

Related Questions