-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from aitomatic/feat/implement_login
Refactor login command
- Loading branch information
Showing
9 changed files
with
112 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import click | ||
import json | ||
from pathlib import Path | ||
from src.app.main import app | ||
from src.login.main import login | ||
|
||
CREDENTIAL_FILE = Path.home().joinpath('.aitomatic/credentials') | ||
|
||
|
||
def load_config(): | ||
if CREDENTIAL_FILE.exists(): | ||
return json.loads(CREDENTIAL_FILE.read_text()) | ||
else: | ||
return {} | ||
|
||
|
||
AUTH_INFO = load_config() | ||
|
||
|
||
@click.group( | ||
context_settings={'obj': AUTH_INFO}, | ||
) | ||
def cli(): | ||
'''Aitomatic CLI tool to help manage aitomatic projects and apps''' | ||
|
||
|
||
cli.add_command(login) | ||
cli.add_command(app) | ||
|
||
|
||
if __name__ == '__main__': | ||
cli() |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
import click | ||
from src.login.cli import authenticated | ||
from src.login.main import authenticated | ||
|
||
|
||
@click.command() | ||
@authenticated | ||
def deploy(): | ||
'''Deploy app to Aitomatic cluster''' | ||
click.echo('Deploy app to Aitomatic') | ||
# click.echo('User info', obj) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import click | ||
from src.app.deploy import deploy | ||
|
||
|
||
@click.group() | ||
def app(): | ||
'''CLI sub-command to help manage aitomatic apps''' | ||
|
||
|
||
app.add_command(deploy) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.2.0 | ||
0.3.0 |