Skip to content

Instantly share code, notes, and snippets.

View dpaola2's full-sized avatar

Dave Paola dpaola2

View GitHub Profile
@dpaola2
dpaola2 / pyrocfile.py
Created November 14, 2011 18:32 — forked from testac/pyrocfile.py
pyrocfile - 100 line Procfile manager in Python
# Pyrocfile - Simple Python impementation of Procfile manager
# Written by Chris Testa (http://testa.co/) in 2011
# Released in the Public Domain
import argparse, logging, os.path, random, re, select, signal, subprocess
def _new_logger(name, color=None):
logger = logging.getLogger(name)
hdlr = logging.StreamHandler()
color, end_color = '\033[9%dm' % (color or random.randint(1, 6)), '\033[0m'
def _resolve_host(func):
def resolve(host, *args, **kwargs):
if host in HOSTS:
return func(HOSTS[host], **kwargs)
return func(host, *args, **kwargs)
return resolve
STAGE = 'stage.example.com'
PRODUCTION = 'www.example.com'
HOSTS = {
'stage':STAGE,
'production':PRODUCTION
}
fab clean:stage
fab deploy:production
fab deploy:192.168.1.102