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

Environment Variables for db connection variables. #10

Closed
tmackenzie opened this issue Oct 4, 2014 · 7 comments
Closed

Environment Variables for db connection variables. #10

tmackenzie opened this issue Oct 4, 2014 · 7 comments
Assignees

Comments

@tmackenzie
Copy link

Given a user that wants to run migrations
When I specify that I want to use environment variables in my environment's setting file

envVariable.enabled=true

And I specify which environment variables to use for the connection settings:

envVariable.driver=DB_DRIVER
envVariable.url=DB_URL
envVariable.username=DB_USERNAME
envVariable.password=DB_PASSWORD

And I run mvn migration:up or mvn migration:pending
Then set up the db connection using the following:
DB_DRIVER for the driver property,
DB_URL for the url property,
DB_USERNAME for the username property,
DB_PASSWORD for the password property
And successfully run the migrations.

I'm willing to code this feature If you would accept the PR.

@nmaves
Copy link
Member

nmaves commented Jan 4, 2015

This feature already exists in the migrations application. You can find out to set up different environments here Init. Let me know if you are looking for something else and I am misunderstanding your request.

@nmaves nmaves self-assigned this Jan 4, 2015
@nmaves nmaves added the wontfix label Jan 4, 2015
@dtanner
Copy link

dtanner commented Apr 7, 2015

If I'm understanding correctly, @tmackenzie is referring to system environment variables. e.g. define and use something like System.getenv("MYBATIS_DB_DRIVER") instead of specifying a properties file.

@tmackenzie
Copy link
Author

yes, I did refer to system environment variables. I have moved onto another migration maven plugin. best of luck.

@h3adache h3adache removed the wontfix label Jul 22, 2015
@h3adache
Copy link
Member

Is this still something people are requesting? There's no vote option for github so I can't tell lol

@dtanner
Copy link

dtanner commented Jul 22, 2015

FWIW - I don't need it, although it would be a nice to have feature. Our current workaround is to use saltstack to dynamically configure the properties file per environment. And for me the ideal solution would actually be for the migrations to pull their config from etcd, since that's what we're using as our centralized configuration management for our DB connection info. I wouldn't expect that to be high on the feature list though. By far the highest priority item for us is a separate test data migrations. i.e. Configurable migration groups.

@h3adache
Copy link
Member

I've always used maven or gradle interpolation do what you just said without the use of saltstack. saltstack does look nice though lol For configurable migration groups, feel free to open an issue or post on the mailing list to discuss it there.

@hazendaz
Copy link
Member

hazendaz commented Apr 9, 2016

Based on comments here, it would appear there is a work around or otherwise it's already supported so I'm going to close the ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants