Managing configuration properties for multiple environments

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:

  1. Create below  folder structure inside hybris config directory. 

config

 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. 

build

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. 

antbuild

Now you have a flexible solution to configure your hybris system more efficiently, thanks to open source apache ant.

 

How to set up a svn environment for hybris projects?

Maintaining a version system for any project is one of the most crucial aspect. Hybris projects are not special in this regard. They also do have the same life cycle in terms of development. We need to maintain different environments like SIT, UAT etc. To provide a local development environment is also equally important.

Since the size of OOB Hybris is huge, it is difficult to put everything in SVN (or GIT). Also it is not advisable. The hybris is improvising every day. A new release should not give us pain in terms of development.

The best practice for versioning a hybris project could be:

  • Put only custom folder, containing customized extensions to versioning software.
  • Pass latest local.properties, localextensions locally to each developers.
  • Maintain copy of latest local.properties, localextensions in each of servers like development and SIT, UAT etc.
  • Hybris software is wrapped around custom folder on each environment.
  • Media folder could possibly in SVN or can be passed locally like property files.

2

  • production environment, normally is not connected to SVN. Rather we take the most stable copy from UAT and deploy it using some deployment tool like , bamboo.