I have a Spring Batch Spring Boot app that needs to be converted to image and later use that in Spring Cloud Data Flow to schedule the job.I have the DEV,UAT,PROD config in
application-properties/dev/application.yml
respectively.We were told to mention the password and username as
password: ${DB_ORCL_PASSWORD}
username: ${DB_ORCL_USER}
I am not sure how the credentials get substituted based on the environment. Is it something i should provide while building the docker image?
Its spring frameworks feature for externalised configuration.
The values in application.properties and application.yml are filtered through the existing Environment when they are used, so you can refer back to previously defined values (for example, from System properties). The standard ${property-value} property-placeholder syntax can be used anywhere within a value.
Note : You need to set environment variables with same property key name in all your environments. Rendering the property values with the values given in environment variables are done by spring. You don't have to worry about that.