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?

Dan Cornilescu
  • 39,470
  • 12
  • 57
  • 97
Robert Garcia
  • 416
  • 3
  • 16

1 Answers1

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:

Community
  • 1
  • 1
Dan Cornilescu
  • 39,470
  • 12
  • 57
  • 97
  • 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? – Robert Garcia May 09 '16 at 04:57
  • 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! – Robert Garcia May 09 '16 at 17:26
  • No worries. You can always come back to it later on, when you have enough rep :) – Dan Cornilescu May 09 '16 at 18:28