How to define spring profiles for different stages with many ANDs, ORs and NOTs?

219 views Asked by At

I have three stages - stage-dev, stage-qa, stage-live, three datacenters - dc1, dc2, dc3 and three brands - brand1, brand2, brand3.

I created three different property files - application-stage-dev.yml, application-stage-qa.yml and application-stage-live.yml and put related properties in it.

For example:

#common live properties here
spring:
   profiles: stage-live 

#brand1 specific live properties here
spring:
   profiles: stage-live, brand1

If I want to define some specific profile definitions (e.g stage-live & dc1 & !brand or (stage-dev | stage-qa) & brand1) the application does not load the right property. But if I do the same definitions in the application.yml file where I put all properties together, it works fine.

How can I separate the properties into different yaml files (based on stages) and define mixed profile definitions?

0

There are 0 answers