简体   繁体   中英

Environment Specific Variables In Google App Engine Java

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?

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:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM