forked from kangqiao/fabdeploy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fabfile.py
46 lines (37 loc) · 899 Bytes
/
fabfile.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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from fabric.api import env, task
from core.util import load_config, log, line_between
from core.init import init_machine
from core.setup import setup_project, setup_web_app, upload_supervisor_conf
from core.deploy import deploy_project, git_pull
from core.useropt import create_super_user
from fabric.operations import sudo, settings, run
@task
@line_between
def config(path=''):
load_config(path)
log('load_config:'+str(env['load_config'])+" in the task->'config()'")
@task
@line_between
def init(path=''):
load_config(path)
init_machine()
@task
@line_between
def setup(path=''):
load_config(path)
setup_project()
setup_web_app()
@task
@line_between
def deploy(path=''):
load_config(path)
deploy_project()
@task
@line_between
def one_step(path=''):
load_config(path)
init()
setup()
deploy()