forked from dragonfly-science/dragonfab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fabfile_template.py
53 lines (38 loc) · 1.2 KB
/
fabfile_template.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
import os
from fabric.api import *
# Set this before dragonfab imports, because it will then set up logging for you
env.DEBUG=False
# This is needed for allowing fabric to be run anywhere in the project directory structure
env.local_dir = os.path.dirname(__file__)
# This will make all environments available as root fabric commands
from dragonfab.env import *
# Utilities for deb building and deployment
from dragonfab import deb
# Package dir specifies where .deb file will go
env.package_dir = os.path.join(env.local_dir, '..')
# This is the name of the deb pacakage that will be built, and where it ends up
env.package_name = 'exampleapp'
@task
def init():
""" Perform initial server setup if necessary/desired """
@task
def data_refresh():
""" Fetch any required data/media files"""
@task
def db_clone():
""" Clone database from live site, or restore from cached dump """
@task
def db_migrate():
""" Setup and perform pending migrations if necessary """
@task
def web_restart():
""" Restart the web server """
@task
def web_mode(mode):
""" Change web site to maintenance mode and back """
@task
def test():
""" Run all tests """
@task
def deploy():
""" Full deployment """