Reputation: 4181
The building process of the current application I'm working on. Currently to build the application a configuration file is assembled based on the environment to be used, a combination of environment type and country, from multiple properties files.
To explain it a bit better, there's a folder hierarchy like this:
|--DEFAULT
|-- UK
|-- Malaysia
|-- India
|--PROD
|-- UK
|-- Malaysia
|-- India
|--DEV
|-- UK
|-- Malaysia
|-- India
Where in each folder there are properties files, that are merged and overwritten based on the combination selected. (So Prod/ file would overwrite Default/ file and Prod/UK would overwrite Default/UK, because there are properties specific to each domain and to each country)
I think is a quite common scenario for applications, specially websites, where most of the code is common but localized configuration changes some functionalities (e.g. payment methods), but I still couldn't find any best practice or building tips for improving/simplifying the process. Has anyone any suggestion?
The application is built in Java, with Maven and Jenkins for dependency and CI management.
Upvotes: 1
Views: 142
Reputation: 16615
Since you are using Jenkins one thing you should definitely consider is using Matrix (Multi-Configuration) Builds. You'd probably have two axes: one ranging over environment types another one over countries. The benefit of this approach is that it will force (or at least nudge) you to factor out the commonalities among the configurations, as well as to treat the differences among them in a similar fashion based on the axes values. It will also reduce the number of points-of-change in the future.
The most serious drawback of this approach, in my opinion, is that Matrix Builds are not as yet 'first class citizens' in Jenkins with the effect that many plugins do not deal with them well, resulting in bugs or lack of features available for regular builds. Another drawback is that Matrix Builds are somewhat confusing at first and require getting used to.
Upvotes: 1