I have Flyway config file - flyway.properties , which contains basic database connection parameters:
flyway.url=jdbc:mysql://localhost
flyway.user=test
flyway.password=test
flyway.schemas=testdb
As I know exposing parameters in such config files is a bad practice. Is it possible to use environment parameters(to create .env file to define params there and to receive them in flyway config?)
You should be able to pass to the config file every possible property, including connections and passwords, so you don't have to store them in the config file. Something like this:
flyway -enterprise -url=jdbc:postgresql://localhost:5498/hamshackradio -user=postgres -password=dude1988 -configFiles="./conf/flyway.conf" migrate
That way you can use the environment variables from the command line much easier. This is the complete list of parameters. If you're calling the API, you can also use envVars(), but I don't have experience with that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With