In an effort to streamline my own deployment system, I decided to make Fabric (and soon, the rest of my infrastructure) send me chat messages when things happen. This is a very simple version of the system to get you started. Basically, you have it connect to an XMPP server (I'm using ejabberd on Ubuntu 12.04), and then send you messages on certain events. This one will shoot out a message when you start the deployment, and when it completes. Handy additions would be an error handler of some sort, which relays those messages to you. This system will be very useful with a continuous integration server (which I'm working on right now), so it can tell you what its progress is, and you can send it queries and commands via a simple chat interface. This whole thing was inspired by Github's HUBOT.
Make sure you have Fabric and the xmpp library installed (preferably in your virtualenv):
Now we will add a few handy functions to our fabfile.py:
Before you do anything, you should call configurexmpp(). This will save the credentials from you credentials file in your env variable for use in sendxmppmessage(). Then, each time you want to send a message to yourself, call sendxmpp_message, and bam! You get it.
Finally, we need to create a credentials file. This should not be stored with your code (so it doesn't wind up in version control). The code above defaults to /etc/xmpp_credentials.ini.