Environment Specific Variables In Google App Engin

2019-07-17 07:45发布

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条回答
\"骚年 ilove
2楼-- · 2019-07-17 08:02

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:

查看更多
登录 后发表回答