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

ddev config and ddev config <provider> must be executable with flags, not interactive #476

Closed
rfay opened this issue Sep 25, 2017 · 4 comments

Comments

@rfay
Copy link
Member

rfay commented Sep 25, 2017

What happened (or feature request):

Currently, ddev config and ddev config <provider> cannot be executed without an interactive terminal session. This is contrary to our overall goals, and is blocking ddev-ui from being able to do config in an appropriate way.

Therefore it's a high-priority goal to add config flags for ddev to make it do whatever config requires (and then whatever ddev config pantheon requires. Help needs to be complete as well.

What you expected to happen:

How to reproduce this:

Version: Please include the output of ddev version, docker version and the project's .ddev/config.yaml.

Anything else do we need to know:

Related source links or issues:

@rfay
Copy link
Member Author

rfay commented Sep 28, 2017

This is a blocker for ddev-ui at this moment, so I made it actionable and added to current sprint.

@beeradb
Copy link
Contributor

beeradb commented Sep 28, 2017

This is probably more difficult than it appears on the surface.

It would be easy to just look at the fields for pantheon and model those at the top level, but the entire idea of provider plugins is that they can provide their own flags and configuration fields. As we add more providers, we should anticipate different fields will be needed for those providers.

There are a couple things missing from providers right now that would make this more elegant:

  • A way register providers so the CLI could be aware of them and make the appropriate commands. Currently, a provider is just an argument to config.
  • A method for providers to register their fields (and thus cli flags).

@rfay rfay assigned rfay and unassigned nmccrory Oct 2, 2017
@rfay
Copy link
Member Author

rfay commented Oct 2, 2017

Interesting that the ddev config pantheon absolutely requires a site that has the same name as the directory of the git clone.

I suspect that we'll have to make another command to grab pantheon info for ddev, to make it available to ddev-ui, so it can offer choices. That shouldn't be too hard in the end. What would we need if we wanted to do this right now @beeradb, just a command to list the available sites (to verify that we're in a directory of the same name)? Is that all it would take? I note that it's prompting for environment, but that's a fixed list right?

@beeradb
Copy link
Contributor

beeradb commented Oct 2, 2017

Interesting that the ddev config pantheon absolutely requires a site that has the same name as the directory of the git clone.

yep! that was definitely a decision we made to reduce the original scope. There's nothing that forces this, but it does make it easier and a bit less awkward. Trying to explain the difference between two site names in the same config to end-users might be difficult.

What would we need if we wanted to do this right now @beeradb

The easiest way at this point would probably be to load the correct provider struct and then send the results to the GUI as JSON. That would be pretty much the same process as loading any config (provider is automatically loaded alongside the main config).

I note that it's prompting for environment, but that's a fixed list right?

Production, staging, and dev are a fixed list. You'll have more in the list if the site is running multidev.

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

No branches or pull requests

4 participants