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

Flexible and extended configuration file #4

Open
holgerw opened this issue Jul 4, 2017 · 3 comments
Open

Flexible and extended configuration file #4

holgerw opened this issue Jul 4, 2017 · 3 comments

Comments

@holgerw
Copy link

holgerw commented Jul 4, 2017

I would like to suggest a more flexible yaml configuration.

  1. Allow every property at the root level, as well as the profile level. Do not require any property at the root level, as long as it is provided at the profile level.

  2. Allow the specification of user, password and host in the yaml file

Following is a sample yaml file, and its execution

profiles:
  dev:
    keyspace: schema_dev
    host: localhost
    user: dev_user
    password: dev_pwd
  dev:
    keyspace: schema_prod
    host: db.my.dmain
    user: prod_user
migrations_path: .
replication:
  class: SimpleStrategy
  replication_factor: 3
cassandra-migrate migrate
cassandra-migrate --profile prod --password prod_pwd migrate

Thanks for cassandra-migrate.

@danielkza
Copy link
Contributor

I'm very positive towards 1, but not so sure about 2. Including the credentials means it's somewhat easy to accidentally run a migration in a production database from a developer machine.

Would accepting a separate credentials file (which should be ignored in source control) work for you?

@holgerw
Copy link
Author

holgerw commented Jul 4, 2017

Yes, your suggestion of the credential file sounds good. Similar to the solution found in Rails, right?

If you would like help in one of the issues, I could try to submit a pull request, but it would be a type of copy, paste and adapt code. Unfortunately I have zero experience with Python.

@fernandezjose
Copy link
Contributor

fernandezjose commented Oct 11, 2017

Another solution to this approach is to use ENV variables in the yaml and then parse it at execution time.

password: {{ENV:PASSWORD}}

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

3 participants