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