-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
43 lines (36 loc) · 921 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import click
import os
import logging
from icecream import ic
from commands.create import create
LOG = logging.getLogger('crusoe')
@click.group()
@click.option('-c', '--config', default='config.yaml', help='Path to the configuration file')
@click.option('-v', '--verbose', count=True, help='Verbosity level')
@click.pass_context
def cli(ctx, config, verbose):
if verbose == 1:
logging.basicConfig(level=logging.INFO)
ctx.ensure_object(dict)
ctx.obj['config'] = os.path.expanduser(config)
@cli.command()
@click.pass_context
def start(ctx):
"""
Start the infrastructure
"""
create(ctx.obj['config'], LOG)
@cli.command()
def terminate():
"""
Tear down the infrastructure
"""
click.echo('Not implemted yet!')
@cli.command()
def check():
"""
Validate the configuration file
"""
click.echo('Not implemted yet!')
if __name__ == '__main__':
cli()