-
Notifications
You must be signed in to change notification settings - Fork 2
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 #58 from minos-framework/0.1.0
0.1.0
- Loading branch information
Showing
71 changed files
with
2,706 additions
and
1,074 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 |
---|---|---|
@@ -1,14 +1,27 @@ | ||
__author__ = """Clariteia Devs""" | ||
__email__ = "[email protected]" | ||
__version__ = "0.0.1" | ||
__author__ = "Minos Framework Devs" | ||
__email__ = "[email protected]" | ||
__version__ = "0.1.0" | ||
|
||
from .constants import ( | ||
MICROSERVICE_TEMPLATE_PATH, | ||
) | ||
from .generators import ( | ||
MicroserviceGenerator, | ||
) | ||
from .main import ( | ||
from .api import ( | ||
app, | ||
main, | ||
) | ||
from .consoles import ( | ||
console, | ||
error_console, | ||
) | ||
from .importlib import ( | ||
FunctionLoader, | ||
) | ||
from .pathlib import ( | ||
get_microservice_target_directory, | ||
get_project_target_directory, | ||
) | ||
from .templating import ( | ||
TemplateFetcher, | ||
TemplateProcessor, | ||
) | ||
from .wizards import ( | ||
Form, | ||
Question, | ||
) |
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,4 +1,4 @@ | ||
from .main import ( | ||
from .api import ( | ||
main, | ||
) | ||
|
||
|
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,34 @@ | ||
import typer | ||
|
||
from ..consoles import ( | ||
console, | ||
) | ||
from .deploy import app as deploy_app | ||
from .init import app as init_app | ||
from .new import app as new_app | ||
from .set import app as set_app | ||
from .utils import app as utils_app | ||
|
||
app = typer.Typer(add_completion=False) | ||
app.add_typer(init_app, name="init") | ||
app.add_typer(new_app, name="new") | ||
app.add_typer(deploy_app, name="deploy") | ||
app.add_typer(utils_app, name="utils") | ||
app.add_typer(set_app, name="set") | ||
|
||
|
||
@app.callback() | ||
def callback(): | ||
"""Minos CLI.""" | ||
|
||
|
||
def main(): # pragma: no cover | ||
"""CLI's main function.""" | ||
console.rule("Welcome to the Minos CLI :robot:") | ||
console.print() | ||
|
||
try: | ||
app() | ||
finally: | ||
console.rule("See you later! :call_me_hand:") | ||
console.print() |
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,42 @@ | ||
from pathlib import ( | ||
Path, | ||
) | ||
from typing import ( | ||
Optional, | ||
) | ||
|
||
import typer | ||
|
||
from ..consoles import ( | ||
console, | ||
) | ||
from ..deploying import ( | ||
MicroserviceDeployer, | ||
ProjectDeployer, | ||
) | ||
|
||
app = typer.Typer(add_completion=False) | ||
|
||
|
||
@app.command("microservice") | ||
def deploy_microservice(name: Optional[str] = typer.Argument(None), path: Path = typer.Option(Path.cwd())) -> None: | ||
"""Deploy a Microservice.""" | ||
|
||
console.print(":wrench: Deploying the microservice...\n") | ||
deployer = MicroserviceDeployer(path, name) | ||
deployer.deploy() | ||
|
||
|
||
@app.command("project") | ||
def deploy_project(path: Path = typer.Option(Path.cwd())) -> None: | ||
"""Deploy a Project.""" | ||
|
||
console.print(":wrench: Deploying the Project...\n") | ||
|
||
deployer = ProjectDeployer(path) | ||
deployer.deploy() | ||
|
||
|
||
@app.callback() | ||
def callback(): | ||
"""Deploys the project""" |
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,40 @@ | ||
from pathlib import ( | ||
Path, | ||
) | ||
|
||
import typer | ||
|
||
from ..consoles import ( | ||
console, | ||
) | ||
from ..templating import ( | ||
TemplateFetcher, | ||
TemplateProcessor, | ||
) | ||
|
||
app = typer.Typer(add_completion=False) | ||
|
||
|
||
@app.command("project") | ||
def init_project() -> None: | ||
"""Initialize a project on the current working directory.""" | ||
|
||
console.print(":wrench: Initializing new Project...\n") | ||
fetcher = TemplateFetcher.from_name("project-init") | ||
processor = TemplateProcessor.from_fetcher(fetcher, Path.cwd(), defaults={"project_name": Path.cwd().name}) | ||
processor.render() | ||
|
||
|
||
@app.command("microservice") | ||
def init_microservice() -> None: | ||
"""Initialize a microservice on the current working directory.""" | ||
|
||
console.print(":wrench: Initializing new Microservice...\n") | ||
fetcher = TemplateFetcher.from_name("microservice-init") | ||
processor = TemplateProcessor.from_fetcher(fetcher, Path.cwd(), defaults={"name": Path.cwd().name}) | ||
processor.render() | ||
|
||
|
||
@app.callback() | ||
def callback(): | ||
"""Initializes a new project or microservice in the current path""" |
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,42 @@ | ||
from pathlib import ( | ||
Path, | ||
) | ||
|
||
import typer | ||
|
||
from ..consoles import ( | ||
console, | ||
) | ||
from ..templating import ( | ||
TemplateFetcher, | ||
TemplateProcessor, | ||
) | ||
|
||
app = typer.Typer(add_completion=False) | ||
|
||
|
||
@app.command("project") | ||
def new_project(path: Path) -> None: | ||
"""Initialize a project on the given directory.""" | ||
|
||
console.print(":wrench: Creating new Project...\n") | ||
|
||
fetcher = TemplateFetcher.from_name("project-init") | ||
processor = TemplateProcessor.from_fetcher(fetcher, path.absolute(), defaults={"project_name": path.name}) | ||
processor.render() | ||
|
||
|
||
@app.command("microservice") | ||
def new_microservice(path: Path) -> None: | ||
"""Initialize a microservice on the given directory.""" | ||
|
||
console.print(":wrench: Creating new Microservice...\n") | ||
|
||
fetcher = TemplateFetcher.from_name("microservice-init") | ||
processor = TemplateProcessor.from_fetcher(fetcher, path.absolute(), defaults={"name": path.name}) | ||
processor.render() | ||
|
||
|
||
@app.callback() | ||
def callback(): | ||
"""Creates a new project or microservice in a given path""" |
Oops, something went wrong.