Skip to content

Instantly share code, notes, and snippets.

@mmourafiq
Created September 26, 2012 21:29
Show Gist options
  • Save mmourafiq/3790708 to your computer and use it in GitHub Desktop.
Save mmourafiq/3790708 to your computer and use it in GitHub Desktop.
fabric
from fabric.api import local
from fabric.api import lcd
def prepare_deployment(branch_name):
local('python manage.py test myapp')
local('git add -p && git commit')
local('git checkout master && git merge ' + branchname)
def deploy():
with lcd('/path/to/my/prod/area/'):
local('git pull /my/path/to/dev/area/')
local('python manage.py migrate myapp')
local('python manage.py test myapp')
local('/my/command/to/restart/webserver')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment