Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
53 lines (38 sloc) 1.35 KB
import os.path
from fabric.api import *
from eizzek import config
env.hosts = [config.SSH_HOST] # format: username@host:port
VIRTUALENV_DIR = '/home/igor/eizzek_env'
EIZZEK_DIR = os.path.join(VIRTUALENV_DIR, 'eizzek')
python = os.path.join(VIRTUALENV_DIR, 'bin', 'python')
twistd = os.path.join(VIRTUALENV_DIR, 'bin', 'twistd')
def update_deps(*deps):
for dep in deps:
print ' - Updating %s' % dep
with cd( os.path.join(VIRTUALENV_DIR, dep) ):
run('git pull')
run('%s setup.py install' % python)
def update(all=False):
''' Update the project. Use :all to update all git depedencies '''
if all:
update_deps('wokkel')
with cd(EIZZEK_DIR):
print ' - Updating eizzek'
run('git pull')
send_config()
def start():
''' Start bot service '''
with cd(EIZZEK_DIR):
run('%s -y eizzek/twistd.tac' % twistd)
def stop(force=False):
''' Stop the bot. Use :force to kill -9. Default is -15 '''
with cd(EIZZEK_DIR):
if 'twistd.pid' not in run('ls'):
print ' - Not running'
return
pid = run('cat twistd.pid')
force = '-9' if force else '-15'
run( 'kill %s %s' % (force, pid) )
def send_config():
''' Send the local config.py to the server '''
put('eizzek/config.py', os.path.join(EIZZEK_DIR, 'eizzek', 'config.py'))
Something went wrong with that request. Please try again.