Affects Version/s: 1.0.0.RELEASE, 1.0.1.RELEASE
Fix Version/s: None
Component/s: @ CORE
Settings for production isn't always ideal for development, and vice versa. When switching environments (say from development to production), we have to change existing configurations to make the application run optimal. These settings include, but are not limited to
- Exception Handling
- Error Pages
- Email Settings
- Path where JNI binaries (DEBUG vs RELEASE) could be found, if any
Have ROO generate applications that will load different settings based on the environment its running in. An "environment" could really be anything, but its suggested that ROO supports
- production - deployed in a production environment
- test - when unit tests are running during development or build
- development - set during development
Ruby on Rails uses the RAILS_ENV environment variable to determine the "environment" it runs under. ROO Applications can do the same. Just, don't use ROO_ENV, but rather use SAMPLE_ENV where SAMPLE is the ROO application name. This will allow for different applications to be deployed to different environments on the same OS. Ensure that when running tests, the environment is correctly set and that when running under development (mvn tomcat:run). If the environment is not specified, use production. Verify that the logs clearly indicated which "environment" the application is running under.
When generating a brand new project, make sure there is a directory for each environment with the corresponding configuration files. Upon startup, load the correct configuration files based on the environment. To create a new environment, simply duplicate another environment, set the environment variable to the new environment and restart the application [unless the app can restart itself].