fabric/fabfile.py

79 lines
1.3 KiB
Python

from fabric.api import env, task
import modules.initialize as initialize
from modules.utils import booleanize
from api import *
#
# Note: this is a hack so I can add the various module files
# into fab --list, but without getting the syntastic errors
# because to do it I need to import them whether or not I'm using
# them. And if I am not using them, I'll get a syntastic error
branch = "development"
def setup():
print("setup fabric configuration files")
def all():
#
# set debugging conditiong
# fab {branch} {fab_command} --set debug=True
if 'debug' in env:
env.debug = booleanize(env.debug)
else:
env.debug = False
#
#
# add the config attribute to env
initialize.environment(branch)
@task
def stage():
""" Staging environment """
#
# set the branch configuration we will
# be working on
global branch
branch = "staging"
print("in staging")
all()
@task
def prod():
""" Production environment """
#
# set the branch configuration we will
# be working on
global branch
branch = "production"
print("in production")
all()
@task
def devel():
""" development environment """
global branch
branch = "development"
all()
devel()