Skip to content

Instantly share code, notes, and snippets.

@bradwright
Created February 9, 2009 23:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bradwright/61085 to your computer and use it in GitHub Desktop.
Save bradwright/61085 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
# Do this when your sudo password on a remote server is different to your local:
# for example, when you're unlocking a private key with a local password
from fabric import _lazy_format
def production():
set(fab_hosts=['myhost.com'])
# ask for remote sudo password
password = getpass.getpass(_lazy_format("Sudo password? "))
set(fab_password=password)
def deploy():
"""Deploy latest version of site to server"""
require('fab_hosts', provided_by=['production'])
sudo('pwd')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment