-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
61 lines (48 loc) · 1.97 KB
/
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import actions
from commando import Application, command, store, subcommand, true, version
from fswrap import File
from commando.util import getLoggerWithConsoleHandler
import yaml
logger = getLoggerWithConsoleHandler('gitbot.builder')
class Engine(Application):
@command(description='gitbot-builder - Create or update a gitbot stack',
epilog='Use %(prog)s {command} -h to get help on individual commands')
@true('-v', '--verbose', help="Show detailed information in console")
@version('--version', version='%(prog)s ' + '0.1')
def main(self, args):
pass
@subcommand('www',
help='Generates and pushes the www project.')
@store('-c', '--config', default='data.yaml', help="Config file")
def www(self, args):
data = yaml.load(File(args.config).read_all())
actions.www(data)
@subcommand('api',
help='Generates and pushes the api project.')
@store('-c', '--config', default='data.yaml', help="Config file")
def api(self, args):
data = yaml.load(File(args.config).read_all())
actions.app(data)
@subcommand('all',
help='Generates and pushes both the projects.')
@store('-c', '--config', default='data.yaml', help="Config file")
def all(self, args):
data = yaml.load(File(args.config).read_all())
actions.all(data)
@subcommand('refresh',
help='Generates both the projects only if needed.')
@store('-c', '--config', default='data.yaml', help="Config file")
def refresh(self, args):
data = yaml.load(File(args.config).read_all())
actions.refresh(data)
@subcommand('validate',
help='Generates both the projects and validates the stack.')
@store('-c', '--config', default='data.yaml', help="Config file")
def validate(self, args):
data = yaml.load(File(args.config).read_all())
actions.validate(data)
def main():
"""Main"""
Engine(raise_exceptions=True).run()
if __name__ == "__main__":
main()