Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: e6a4658492
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 32 lines (23 sloc) 0.911 kb
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 = ['ubuntu@staging.openstates.org']
    env.key_filename = KEY_FILENAME

def production():
    env.hosts = ['ubuntu@openstates.org']
    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('~openstates/src/openstates/'):
        _venv('billy-dump-missing-leg-ids ' +
              state)
        get('/ext/openstates/src/openstates/%s_missing_leg_ids.csv' % state,
            '%s_missing_leg_ids.csv' % state)
Something went wrong with that request. Please try again.