forked from frappe/press
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli.py
More file actions
56 lines (41 loc) · 1005 Bytes
/
cli.py
File metadata and controls
56 lines (41 loc) · 1005 Bytes
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
44
45
46
47
48
49
50
51
52
53
54
55
56
# -*- coding: utf-8 -*-
# Copyright (c) 2020, Frappe and contributors
# For license information, please see license.txt
import click
from backbone.hypervisor import Hypervisor, Shell
from backbone.tests import run_tests
@click.group()
def cli():
pass
@cli.group()
def hypervisor():
pass
@hypervisor.command()
def setup():
shell = Shell()
hypervisor = Hypervisor(shell=shell)
hypervisor.setup()
@hypervisor.command()
@click.option("--size", default=16384, type=int)
@click.option("--scaleway", is_flag=True)
def build(size, scaleway):
shell = Shell()
hypervisor = Hypervisor(shell=shell)
if scaleway:
hypervisor.build_scaleway(size=size)
else:
hypervisor.build(size=size)
@hypervisor.command()
def up():
shell = Shell()
hypervisor = Hypervisor(shell=shell)
hypervisor.up()
@hypervisor.command()
@click.option("-c", "--command")
def ssh(command):
shell = Shell()
hypervisor = Hypervisor(shell=shell)
hypervisor.ssh(command=command)
@cli.command()
def tests():
run_tests()