I am looking to setup testing & staging environments. We have many config parameters that depends on environment i.e on test environment it should send out email to xyz@test.com while on production it should send email to xyz@production.com. Also, we are using many third-party services (i.e Salesforce, PayPal) that provides separate credentials/URL to access test environments.
I am thinking of creating a secured web service that will return value for a given key based on request IP address. i.e if request is from testing server machine then it will return xyz@test.com while if same code is running in production it will return xyz@production.com
Basically, I want to keep my code & config deployment easier to manage.
Can you please review and suggest?
IF the list of properties that you are considering to configure for each environment is small, then you can achieve that reliably from a build environment, where the build can pick up from properties file the required details. However the risk is running production credentials on a development environment, for that you need to be careful.