forked from openstates/openstates-scrapers
-
Notifications
You must be signed in to change notification settings - Fork 1
/
fabfile.py
31 lines (23 loc) · 863 Bytes
/
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
from fabric.api import run, env, cd, sudo, get
KEY_FILENAME = '/home/james/.ssh/openstates_master.pem'
def staging():
env.hosts = ['[email protected]']
env.key_filename = KEY_FILENAME
def production():
env.hosts = ['[email protected]']
env.key_filename = KEY_FILENAME
def update():
sudo('cd ~openstates/src/openstates && git pull', user='openstates')
sudo('cd ~openstates/src/billy && git pull', user='openstates')
def restart_uwsgi():
sudo('restart uwsgi')
def restart_nginx():
sudo('/etc/init.d/nginx restart')
def _venv(cmd):
sudo('source ~openstates/site-venv/bin/activate && ' + cmd)
def get_leg_ids_csv(state):
with cd('/tmp/'):
_venv('billy-dump-missing-leg-ids ' +
state)
get('/tmp/%s_missing_leg_ids.csv' % state,
'%s_missing_leg_ids.csv' % state)