I want to have different property values in a bootstrap.yml
file depending on a spring profile passed to a starting application (the same way as it works for application-{profile-name}.yml
).
How is it possible?
According to the documentation it should work pretty much the same.
Changing the Location of Bootstrap Properties:
If there is an active profile (from
spring.profiles.active
or through theEnvironment
API in the context you are building), properties in that profile get loaded as well, the same as in a regular Spring Boot app — for example, frombootstrap-development.properties
for adevelopment
profile.
That is it should be possible to suffix the bootstrap yaml with the environment name to make it take effect.