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

Add auto-configuration command #21

Closed
guyzmo opened this issue May 30, 2016 · 0 comments
Closed

Add auto-configuration command #21

guyzmo opened this issue May 30, 2016 · 0 comments
Assignees
Milestone

Comments

@guyzmo
Copy link
Owner

guyzmo commented May 30, 2016

create a command to autoconfigure git-repo, which would be:

git repo configure (github|gitlab|bitbucket)

which would then run an authentication loop, to query auth tokens, asking for user/pass for both github and gitlab, and record login:pass for bitbucket (until oauth config is implemented).
Eventually, it could ask for custom gitlab URLs as well.

and it would then populate ~/.gitconfig with:

alias.hub = repo hub
alias.lab = repo lab
alias.bb = repo bb

Here's a mockup of how the interactions could be:

% git repo configure
• Do you want to configure github access? 
[Yn]> Y
Enter your username: 
'guyzmo'> foobar
Enter your password:
>
Please wait while getting authenticated…
Done, cheers! 🍻
• Do you want to configure gitlab access?
[Yn]> Y
Enter your username: 
'$USER'> barfoo
Enter your password:
>
Please wait while getting authenticated…
Done, cheers! 🍻
• Do you want to configure bitbucket access?
[Yn]> Y
Enter your username: 
'$USER'> fubar
Enter your password:
>
Done, cheers! 🍻
• Do you want to add a custom gitlab access?
[yN]> Y
Enter the URL of the gitlab:
> https://my_gitlab.my_domain.tld
Enter the short name of the service:
> mine
Enter your username:
'$USER'> ford.prefect
Enter your password:
>
Please wait while getting authenticated…
Done, cheers! 🍻
• Do you want to add a custom gitlab access?
[yN]> n
Thank you, here's your configuration:
Service   | Name | Username     | Password | Token    | URI
--------- | ---- | ------------ | -------- | -------- | -----
Github    | hub  | foobar       | *        | Acquired | *
Gitlab    | lab  | barfoo       | *        | Acquired | *
Bitbucket | bb   | fubar        | Acquired | *        | *
Gitlab    | mine | ford.prefect | *        | Acquired | https://my_gitlab.my_domain.tld
@guyzmo guyzmo modified the milestones: 1.6, 1.7 May 30, 2016
@guyzmo guyzmo added ready and removed in progress labels Jun 6, 2016
@guyzmo guyzmo closed this as completed Jun 6, 2016
@guyzmo guyzmo removed the ready label Jun 6, 2016
@guyzmo guyzmo self-assigned this Jun 7, 2016
guyzmo added a commit that referenced this issue Jun 21, 2016
* Improved CLI API ;
* Made repo slug optional for commands that don't need it ;
* Added auto configuration command.

* fixes issue #9:  Make requests for merges not needing repo slug
* fixes issue #17: Refactoring of main function
* fixes issue #21: Add auto-configuration command

Signed-off-by: Guyzmo <guyzmo+github@m0g.net>
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

1 participant