def __enter__(self): run_local('git submodule init && git submodule update') git_cmd = render('git rev-parse %(branch)s | cut -c 1-9') env.release = local(git_cmd, capture=True) env.release = re.sub('[\r\n]', '', env.release) env.local_bundle = tempfile.mkstemp(suffix='.tar')[1] git_cmd = render('git archive --format=tar %(branch)s > %(local_bundle)s') run_local(git_cmd)
def vagrant(): "Using Vagrant for development testing." env.user = '******' env.hosts = ['127.0.0.1:2222'] # Check vagrant machine status and power it up if off status = cuisine.run_local('vagrant status | grep default') if 'running' in status: puts('Vagrant already up.') else: puts("Vagrant VM powered off so starting...") cuisine.run_local('vagrant up') puts("Vagrant up!")
import sys import cuisine from fabric.api import env from fabric.colors import green, red from fabric.utils import puts from fabric.decorators import task try: from src.settings.enviroment import DATABASES except ImportError: print "Copy src/settings/enviroment.py.txt to src/settings/enviroment.py" sys.exit(0) env.user = '******' env.hosts = ['127.0.0.1:2222'] result = cuisine.run_local('vagrant ssh-config | grep IdentityFile') env.key_filename = result.split()[1].replace("\"", "") env.project_path = '/home/vagrant/src/' ## ## Bootstrap ## @task def bootstrap(): """ Bootstrap vagrant enviroment """ puts(red('###############################')) puts(red('### Setup host')) puts(red('###############################'))