Is there a way I can run code before database connection?
I have a problem
Jenkins has a vault that stores the DB password. This vault property names do not accept lowercase, periods or dashes. and I believe it sets it on the OS system variables (I’m not very experienced with Docker)
So the setting main.datasource.username is now “MAIN_DATASOURCE_USERNAME”
I’m thinking on running some code as soon spring boot starts.
It would be right after the spring profile is read
later I get the keys and values of the sensitive variables from the OS (if possible), change the key back to lowercase with periods and update these variables before the database connection starts.
Does this sound like a feasible plan?