Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration file path from environment variable #608

Closed
p1c2u opened this issue Oct 7, 2019 · 5 comments

Comments

@p1c2u
Copy link

@p1c2u p1c2u commented Oct 7, 2019

It would be nice to have possibility to set config path with environment variables.

In my case this would be useful for running migrations in docker container. Environment variables are most common and easiest way to configure containers. That's why i would prefer to use ALEMBIC_CONFIG environment variable than alembic -c ${ALEMBIC_CONFIG} which is painful to pass such command.

It's similar like in docker-compose that you can specify compose file with -f option or with COMPOSE_FILE environment variable.

Here's my PR for this #607

@zzzeek

This comment has been minimized.

Copy link
Member

@zzzeek zzzeek commented Oct 7, 2019

mmm OK I know we see these "FOO_CONFIG" environment variables around but I'm asking on twitter because it's still not clicking for me what we really get from these..unless the command is in some kind of script you don't immediate control over

@zzzeek

This comment has been minimized.

Copy link
Member

@zzzeek zzzeek commented Oct 7, 2019

ok and our first tweet is folks putting it in .zshrc or something like that

@zzzeek

This comment has been minimized.

Copy link
Member

@zzzeek zzzeek commented Oct 7, 2019

OK I am in favor of ALEMBIC_CONFIG however I believe if someone passes -c on the command line, that should supersede ALEMBIC_CONFIG.

@zzzeek

This comment has been minimized.

Copy link
Member

@zzzeek zzzeek commented Oct 9, 2019

ping...I'm going to do the simpler patch I proposed if I don't hear from you

@sqla-tester

This comment has been minimized.

Copy link
Collaborator

@sqla-tester sqla-tester commented Oct 11, 2019

Mike Bayer has proposed a fix for this issue in the master branch:

Allow ALEMBIC_CONFIG for config file location https://gerrit.sqlalchemy.org/1514

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.