An enterprise level solution always have different environments for different stakeholders like local, dev for developers, UAT/SIT for QAs etc. Then we have a production environment.
Every environment may have different characteristics, like different email SMTP servers or different database etc. Hybris based projects are no different and have multiple multiple environment based on lifecycle of project.
Now the problem is how to manage configuration for multiple environments. Of course, we can do it manually, where we can have different property files set up on individual server. But this solution is not modular and efficient.
The approach i am going to present is based on using apache ant to create environment specific file. It will copy properties from one common file and one environment specific file and merge them to create a complete local.properties file.
Follow below steps:
- Create below folder structure inside hybris config directory.
2. Place your properties in each one of local files as per environment related values. The property which have same values across environment will go to common local property file.
3. Create a build.xml file inside config project and copy below content.
4. Now we have a ant build xml, which will create a environment specific property file. You can run like below, pass the environment name as required.
Now you have a flexible solution to configure your hybris system more efficiently, thanks to open source apache ant.