mirror of
https://github.com/kennethreitz-archive/reflog.git
synced 2026-06-05 07:26:14 +00:00
46 lines
652 B
Python
46 lines
652 B
Python
#!/usr/bin/env python
|
|
# -*- coding: utf-8 -*-
|
|
|
|
from fabric.api import *
|
|
|
|
|
|
CMD_TEMPLATE = '{0}'
|
|
|
|
|
|
def _run(cmd):
|
|
local(CMD_TEMPLATE.format(cmd))
|
|
|
|
|
|
def prod():
|
|
"""Runs all command on the production instance."""
|
|
global CMD_TEMPLATE
|
|
|
|
CMD_TEMPLATE = 'epio run_command {0}'
|
|
|
|
|
|
def deploy():
|
|
"""Deploys the application"""
|
|
|
|
prod()
|
|
local('epio upload')
|
|
migrate()
|
|
|
|
|
|
def migrate():
|
|
"""Runs migrate script."""
|
|
|
|
_run('./manage.py migrate')
|
|
|
|
|
|
def clear_db():
|
|
"""Clears the Redis database."""
|
|
|
|
_run('./manage.py clear_db')
|
|
|
|
|
|
|
|
def sync():
|
|
"""Imports everything from various services."""
|
|
|
|
_run('./manage.py sync')
|