Categories
Backend DevOps

Providing environment variables default values via Spring application.yaml

Storing backend application configuration values in environment variables is a common practice that makes most DevOps works easier. In a recent project, my task was to setup a CI/CD pipeline for a Java Spring application. In order to do that, I had to configure the application so that it would read the database connection values from env variables in both staging and production environment while falling back to default values if the desired variables were not provided.