"""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'