summaryrefslogtreecommitdiff
path: root/fabfile/setups.py
blob: f4d1de8e4a529e0ada03460c97824c6bee2626d2 (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
"""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 = ['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 = ['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')