-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathenvironments.py
42 lines (37 loc) · 1.21 KB
/
environments.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
from fabric.api import env, settings, run
from contextlib import contextmanager as _contextmanager
from time import gmtime, strftime
from fabric.api import *
from lib.fabutils.vagrant import get_vagrant_params
from pprint import pprint
@_contextmanager
def common():
env.debug = False
yield
env.project_name = 'visiondataset'
env.project_title = 'visiondataset'
env.db_name = env.project_name
env.project_root = '/home/%s/sites/%s' % (env.user, env.project_name)
env.python_path = "/home/%s/.virtualenvs/%s" % (env.user, env.project_name)
env.uwsgi_port = 9000
env.use_ssh_config = False
env.branch = "master"
env.release = strftime('%Y%m%d%H%M%S', gmtime())
def vagrant():
'''
Embeeded vagrant environment.
'''
env.debug = True
vp = get_vagrant_params()
with common():
env.user = vp.get('user')
env.domain = 'localhost'
env.hosts = ['%s:%s' % (vp.get('host'), vp.get('port'))]
env.key_filename = vp.get('identity_file')
env.debug = False
# TODO: You edit this
def production():
with common():
env.user = ''
env.hosts = []
env.domain = ''