/
fabfile.py
35 lines (28 loc) · 1.01 KB
/
fabfile.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from fabric.api import run, sudo, puts, abort, env, open_shell, local, put
from fabric.colors import green, red, yellow
import os
if os.environ.get('TARDIS_HOME') is None:
puts(red("You must enter the Tardis first"))
puts("")
puts(red("pr0tip: "))
puts("")
puts(green("$ git clone git@github.com:CyanogenMod/tardis.git # Private Repository"))
puts(green("$ source tardis/bin/activate"))
abort("Unable to read TARDIS_HOME")
env.use_ssh_config = True
env.ssh_config_path = os.path.join(os.environ['TARDIS_HOME'], "config", "ssh_config")
env.key_filename = os.path.join(os.environ['TARDIS_HOME'], "keys", "fab_rsa")
def all():
env.user = "fabric"
env.hosts = ['8.29.134.126:22221']
def uptime():
run('uptime')
def shell():
open_shell()
def deploy():
local("rm -rf dist")
local("python setup.py bdist_egg")
sudo("rm -rf /tmp/CMStats.egg")
put("dist/CMStats-*-py*.egg", "/tmp/CMStats.egg")
sudo("easy_install /tmp/CMStats.egg")
sudo("supervisorctl restart stats")