blob: 264b2372de3404d3c7574f17e26c6f97746a2821 (
plain)
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
|
"""Setups to deploy to.
"""
from os.path import join as join_path
from fabric.api import *
@task
def stage():
"""Defines stage setup.
"""
env.stage = True
env.git_branch = 'master'
env.hosts = ['subweb@oberon.sublab.org']
env.home = '/home/subweb'
env.root = join_path(env.home, 'stage')
finalize()
@task(alias='prod')
def production():
"""Defines production setup.
"""
env.stage = False
env.git_branch = 'master'
env.hosts = ['subweb@oberon.sublab.org']
env.home = '/home/subweb'
env.root = join_path(env.home, 'production')
finalize()
def finalize():
"""Performs the final setup.
"""
env.config = join_path(env.home, 'config')
env.src_root = join_path(env.root, 'subweb')
env.pip_file = join_path(env.src_root, 'requirements.txt')
env.proj_root = join_path(env.src_root, 'sublab_project')
env.manage_py = join_path(env.proj_root, 'manage.py')
env.git_url = 'git://git.sublab.org/subweb.git'
|