Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from __future__ import with_statement
- from fabric.api import env, run, put, local, cd
- env.hosts = ['localhost']
- env.path = '~/www/app'
- def build_egg():
- local('python setup.py bdist_egg')
- def cleanup():
- local('rm -rf build')
- local('rm -rf dist')
- def start():
- with cd(env.path):
- run('PYTHONPATH=app.egg paster serve app.ini --daemon --pid-file=app.pid')
- def stop():
- with cd(env.path):
- run('paster serve --stop-daemon --pid-file=app.pid')
- def deploy():
- build_egg()
- put('app.ini', env.path)
- put('dist/*.egg', env.path+"/app.egg")
- cleanup()
Add Comment
Please, Sign In to add comment