deis / workflow-cli

The CLI for Deis Workflow
http://deis.com
MIT License
31 stars 43 forks source link

feat(*): allow configuration flag #169

Closed Joshua-Anderson closed 8 years ago

Joshua-Anderson commented 8 years ago

Usage: deis -c path/to/config.json

If you want to quickly switch between different clusters, it also works like $DEIS_PROFILE: deis -c dev

$DEIS_PROFILE behaves identically to the config flag.

Fixes #28

deis-bot commented 8 years ago

@bacongobbler and @arschles are potential reviewers of this pull request based on my analysis of git blame information. Thanks @Joshua-Anderson!

codecov-io commented 8 years ago

Current coverage is 5.46% (diff: 4.83%)

Merging #169 into master will increase coverage by 0.26%

@@            master      #169   diff @@
========================================
  Files           48        48          
  Lines         3386      3443    +57   
  Methods          0         0          
  Messages         0         0          
  Branches         0         0          
========================================
+ Hits           176       188    +12   
- Misses        3188      3236    +48   
+ Partials        22        19     -3   

Powered by Codecov. Last update 16312db...66b3295

vdice commented 8 years ago

@Joshua-Anderson Is there a corresponding docs PR for adding to/updating http://docs-v2.readthedocs.io/en/latest/users/cli/#support-for-multiple-profiles?

Joshua-Anderson commented 8 years ago

E2E PR: deis/workflow-e2e#301

Joshua-Anderson commented 8 years ago

I added the following line when logging in: Configuration file written to /Users/<user>/.deis/client.json. This should give people better visibility about where their sensitive files are stored and makes it easier to debug issues with setting $DEIS_PROFILE.

I also opened a docs PR at deis/workflow#440

vdice commented 8 years ago

Tested locally/manually, looks good!

$ deis apps:list -c ~/vrd2-config.json
=== Apps
foo
$ DEIS_PROFILE=~/vrd-config.json deis apps:list
=== Apps
bar
Joshua-Anderson commented 8 years ago

@bacongobbler I edited the App commands to use an approach like what you suggested. What do you think?

bacongobbler commented 8 years ago

implementation looks fine, but it seems like we treat apps differently than the rest of the parser package, and we're still adding the --config flag to every other command. Is there still something blocking us here to implement this functionality for the rest of the parser package?

Joshua-Anderson commented 8 years ago

@bacongobbler I made the changes you suggested for the Apps commands as a proof of concept to show you before doing the rest. If Apps looks good to you I'll go ahead and do the rest.

Joshua-Anderson commented 8 years ago

@bacongobbler: Ready for a rereview. I've updated the entire codebase to use these changes.

bacongobbler commented 8 years ago

there's still two comments pending, otherwise LGTM:

https://github.com/deis/workflow-cli/pull/169#discussion_r74610237 https://github.com/deis/workflow-cli/pull/169#discussion_r74610436

Joshua-Anderson commented 8 years ago

@bacongobbler Sorry I overlooked those, I fixed them up.

Joshua-Anderson commented 8 years ago

Just rebased and added flags to deis maintenance:*

Joshua-Anderson commented 8 years ago

Successful e2e run in deis/workflow-e2e#301