bikeshedder / tusker

PostgreSQL migration management tool
The Unlicense
208 stars 17 forks source link

Add support for environment variables in tusker.toml #23

Closed ledburyb closed 1 year ago

ledburyb commented 1 year ago

I manage my environment variables using Doppler and would like to be able to use them in my config

bikeshedder commented 1 year ago

Sorry for answering late. I completely overlooked this issue.

Any ideas how that would look like? How about TUSKER_SCHEMA_FILENAME, etc. which override the defaults.

Though a tusker.toml would take precedence over the environment variables, right?

Alternatively we could also add interpolation support for ${...}strings so you can use them in the tusker.toml:

[schema]
filename = "${TUSKER_SCHEMA_FILENAME}"
ledburyb commented 1 year ago

Hey, I actually already opened a PR to add the interpolation support you suggested. I think that's the easiest way to do it and matches similar tools like docker-compose.

bikeshedder commented 1 year ago

Oh my. :facepalm:

I looked at this from my mobile phone and didn't notice it was an actual PR. I thought it was just an issue with no code attached. My answer must have looked totally doofus. :rofl:

I just left two comments regarding your changes.

ledburyb commented 1 year ago

Thanks for getting back to me. I've updated the PR as you suggested.

bikeshedder commented 1 year ago

Very nice. I'll merge this and #26 asap. and create a 0.5.0 release.

Could you please provide a short changelog text, too?

ledburyb commented 1 year ago

OK, done

bikeshedder commented 1 year ago

Perfect. Thanks a lot. :+1:

bikeshedder commented 1 year ago

I just released Tusker 0.5.0 including your changes: https://pypi.org/project/tusker/0.5.0/

Thanks a lot for your contribution! :+1: