3

What is the best way to store environment specific variables for Java Google App Engine. Right now I am storing the different values for urls or index names in a properties files. I just keep getting nervous that I will forget to change the values used for my local machine to the production next time I deploy.

Is there something we can set in app engine for our app to pull from when it's running on app engine and a file for local for example?

1 Answer 1

0

If the environment variables you have in mind are only needed after your application gets control you could programatically make the properties file loading decision using a method like this: How to check in Java App Engine if we are on development workstation

For app config variables (outside of the app's control) or for staging/production scenarios I'm using different branches in my version control system. The strategy is described in these answers:

Sign up to request clarification or add additional context in comments.

3 Comments

Oh cool! Thank you for that. That will come in handy for my current situation. Though if I were to set up a staging and production app engine instance this wouldn't work. Any ideas that would cover both scenarios?
I will look into your added edit. Very cool! Thank you! I marked as answer but don't have enough reputation for it to do anything :( Thanks again!
No worries. You can always come back to it later on, when you have enough rep :)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.