diff options
Diffstat (limited to 'fabfile/setups.py')
-rw-r--r-- | fabfile/setups.py | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/fabfile/setups.py b/fabfile/setups.py new file mode 100644 index 0000000..f4d1de8 --- /dev/null +++ b/fabfile/setups.py @@ -0,0 +1,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') |