Challenge Overview
Task Overview
In current CSFV CMS application deployment, we have different set of configuration files to maintain, if it is development environment the files are config/configuration.js, and config/settings-dev.js, if it is production the files are config/configuration.js and config/setting-prod.js.
In this challenge we are moving to use environment variables insetad of config/settings-dev.js and config/settings-prod.js
Task Requirements
- Remove config/settings-dev.js and move all variables to be environment variables.
- Add env-sample to root directory, this sample will be cloned into .env when deploying and will be read by configuration.
- Add .env to .gitignore file.
- The env variables should only include variables required by the deployment, current settings-dev.js contains lots of varaibles that are not needed by cms application. So you need to clean it up and use only needed environment variables.
- config/configuration.js should not include any hardcoded value that depends on the environment, everything should be moved to .env file instead.
- config/configuration.js will read environment variables directly from .env (env-sample) file.
- We use 'forever' module in production, your solution must properly allow forever to parse and read .env file and pass it to config/configuration.js, if it is not supported by forever then you need to add support from withinc config/configuration.js to allow reading .env file.
- Cleanup the files we no more need.
Github Code
We have the CSFV code base in private github.com account, please request access in forums if you don't have.
https://github.com/topcoderinc/csfv_cms_module
Deliverable
- Git patch file of changes.
- Text file with notes to reviewer.
Final Submission Guidelines
.