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

Nebari Typer CLI #1443

Merged
merged 47 commits into from
Oct 7, 2022
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
a122688
Initial typer CLI implmentation
Aug 29, 2022
eb8523f
edit logic
Aug 29, 2022
731bc14
Nebari cli: Add files _init.py and main.py (#1423)
asmijafar20 Sep 2, 2022
372fa85
Order CLI commands
Sep 7, 2022
a9fac68
Nebari typer cli commands (#1432)
asmijafar20 Sep 12, 2022
a445389
Nebari Render Command (#1433)
asmijafar20 Sep 13, 2022
c6142d0
Updates to init
Sep 16, 2022
9164c20
More work on init
Sep 18, 2022
6259384
Nebari deploy and destroy commands (#1436)
asmijafar20 Sep 19, 2022
d3a5877
Add guided-init
Sep 20, 2022
0d67af2
Add deploy flags and change repository default value (#1441)
asmijafar20 Sep 20, 2022
6a31dee
Nebari Typer CLI
asmijafar20 Sep 20, 2022
decb7b0
Add pre-commit
asmijafar20 Sep 20, 2022
9468910
Merge branch 'main' into typer_cli
iameskild Sep 20, 2022
4e66894
Add disable_checks in deploy command
asmijafar20 Sep 22, 2022
eafe6f5
Combine guided-init and init, part 1
Sep 22, 2022
fd6a227
Remove `dotenv` work. (#1472)
asmijafar20 Sep 24, 2022
8f93e4a
Merge branch 'typer_cli' of github.com:Quansight/qhub into typer_cli
Sep 26, 2022
a9ba966
guided-init clean up
Sep 27, 2022
0e15458
Merge branch 'main' into typer_cli
iameskild Sep 27, 2022
ecc5f65
Added `support`, `cost`, `upgrade` and `keycloak` commands. (#1468)
asmijafar20 Sep 27, 2022
5a771e4
clean up
Sep 27, 2022
28404e5
update help messages
Sep 27, 2022
3911f13
Update qhub/cli/_init.py
iameskild Sep 29, 2022
562a8fc
Update qhub/cli/_init.py
iameskild Sep 29, 2022
1ba974e
Merge branch 'main' into typer_cli
iameskild Oct 3, 2022
06d882b
Changes from review, part 1
Oct 3, 2022
20f09d4
Update qhub/cli/_init.py
iameskild Oct 3, 2022
62dcbfd
Update qhub/cli/_init.py
iameskild Oct 3, 2022
2abd34a
Update qhub/cli/_init.py
iameskild Oct 3, 2022
4c54317
Update qhub/cli/_init.py
iameskild Oct 3, 2022
580ad0b
Update qhub/cli/_init.py
iameskild Oct 3, 2022
3b33748
Update qhub/cli/_init.py
iameskild Oct 3, 2022
cd59e6d
Update qhub/cli/_init.py
iameskild Oct 3, 2022
05dcb8c
Update qhub/cli/main.py
iameskild Oct 3, 2022
fe4fb79
Changes from review, part 2
Oct 3, 2022
6b92168
Update env, clean up
Oct 3, 2022
44ef8df
Changes from review, part 3
Oct 3, 2022
edcb910
Minor update
Oct 3, 2022
4285ebf
Changes based review, part 4
Oct 3, 2022
8a5739c
more clean up
Oct 4, 2022
6ba50e6
Add `version` options to Nebari CLI (#1476)
asmijafar20 Oct 4, 2022
acfe29d
Change colour from blue1 to green and spring_green to blue
asmijafar20 Oct 4, 2022
3fbf044
Add suggested changes, Remove extra spaces
asmijafar20 Oct 4, 2022
54119a9
Add pre-commit
asmijafar20 Oct 4, 2022
089da20
change kubernetes msg
asmijafar20 Oct 6, 2022
11f6f3c
Update CI to use new nebari cli entrypoint (#1480)
iameskild Oct 7, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
496 changes: 496 additions & 0 deletions qhub/cli/_init.py

Large diffs are not rendered by default.

52 changes: 52 additions & 0 deletions qhub/cli/_keycloak.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
from pathlib import Path
from typing import Tuple

import typer

from qhub.keycloak import do_keycloak

app_keycloak = typer.Typer(
add_completion=False,
no_args_is_help=True,
rich_markup_mode="rich",
context_settings={"help_option_names": ["-h", "--help"]},
)


@app_keycloak.command()
def add_user(
add_users: Tuple[str, str] = typer.Option(
..., "--user", help="Provide both: <username> <password>"
),
config_filename: str = typer.Option(
...,
"-c",
"--config",
help="qhub configuration file path",
),
):
"""Add a user to Keycloak. User will be automatically added to the [italic]analyst[/italic] group."""
if isinstance(config_filename, str):
config_filename = Path(config_filename)

args = ["adduser", add_users[0], add_users[1]]

do_keycloak(config_filename, *args)


@app_keycloak.command()
def list_users(
config_filename: str = typer.Option(
...,
"-c",
"--config",
help="qhub configuration file path",
)
):
"""List the users in Keycloak."""
if isinstance(config_filename, str):
config_filename = Path(config_filename)

args = ["listusers"]
iameskild marked this conversation as resolved.
Show resolved Hide resolved

do_keycloak(config_filename, *args)
Loading