Skip to content


Subversion checkout URL

You can clone with
Download ZIP
branch: committee-topi…
Fetching contributors…

Cannot retrieve contributors at this time

61 lines (50 sloc) 1.806 kb
Open-Knesset fabfile. Usage:
$ fab [dev|live] setup deploy # for the first time
$ fab [dev|live] deploy # to run the latest version
# Default release is 'current'
from __future__ import with_statement
from fabric.api import *
from fabric.contrib.console import confirm
env.repository = 'git://'
def dev():
"""Staging server settings"""
env.path = '/usr/local/src/dev.oknesset'
env.hosts = ['daonb@']
def live():
"""Production server settings"""
env.path = '/usr/local/src/oknesset'
env.hosts = ['']
def setup():
Setup a fresh env and install everything we need so it's ready to deploy to
run('mkdir -p %s' % env.path)
def deploy(fork='ofri', branch='master'):
"""Deploy the latest version of the site to the server and restart apache"""
update(fork, branch)
def clone_repo():
"""Do initial clone of the git repo"""
with cd(env.path):
run('git clone %(repository) .' % env)
def update(fork='ofri', branch='master'):
"""Pull the latest code into the git repo and copy to a timestamped release directory"""
with cd(env.path):
run('git checkout src/knesset/templates/last_build.txt')
run('git pull %s %s' % (fork, branch))
run('date > src/knesset/templates/last_build.txt')
def install_env():
"""Install the required packages using buildout"""
with cd(env.path):
# build all the packages
# Run our migrations
run('bin/django syncdb --noinput --migrate')
def refresh_server():
"""Restart the web server"""
sudo('kill -HUP `head -n1 /tmp/`')
Jump to Line
Something went wrong with that request. Please try again.