Skip to content

Instantly share code, notes, and snippets.

@pierrejean-coudert
Created March 28, 2012 13:24
Show Gist options
  • Save pierrejean-coudert/2226146 to your computer and use it in GitHub Desktop.
Save pierrejean-coudert/2226146 to your computer and use it in GitHub Desktop.
Vagrant fabric cuisine experiment

install virtual box

https://www.virtualbox.org/wiki/Downloads

install vagrant

http://vagrantup.com/

install git

http://code.google.com/p/msysgit/downloads/list?can=3&q=official+Git

install fabric

install pywin32-216.win32-py2.6.exe from http://sourceforge.net/projects/pywin32/files/pywin32/

install MinGw http://sourceforge.net/projects/mingw/files/MinGW/ avec option C++ compiler, Minimum System, Developper

add “C:MinGWbin” to your PATH in Windows. From the desktop, right-click My Computer and click Properties. In the System Properties window, click on the Advanced tab. In the Advanced section, click the Environment Variables button. Finally, in the Environment Variables window (as shown below), highlight the Path variable in the Systems Variable section and click the Edit button. Add or modify the path lines with the paths you wish the computer to access. Each different directory is separated with a semicolon as shown below.

Edit ( create if not existing ) distutils.cfg located at C:Python26Libdistutilsdistutils.cfg to be :

[build] compiler=mingw32

:

pip install --upgrade fabric

install cuisine

:

pip install --upgrade cuisine

create the VM

:

mkdir vagrant cd vagrant

git clone git://gist.github.com/2226146.git . vagrant up

Configure the VM

:

fab vagrant setup
from cuisine import *
from fabric.api import *
def vagrant():
"Use Vagrant for testing"
env.user = 'vagrant'
env.hosts = ['127.0.0.1:2222']
# retrieve the IdentityFile:
result = local('vagrant ssh-config | grep IdentityFile', capture=True)
env.key_filename = result.lstrip('IdentityFile').strip() # parse IdentityFile
def setup():
dev = ['vim','joe', 'subversion', 'git-core', 'build-essential', 'gettext']
py = ['python2.6', 'python2.6-dev', 'python-setuptools', 'python-pip', 'python-dev', 'python-virtualenv']
svr = ['nginx', 'postgresql', 'pgbouncer', 'supervisor']
tool = ['mc', 'iftop', 'apache2-utils']
for p in dev+py+svr+ tool :
package_ensure(p)
sudo('pip install virtualenvwrapper')
Vagrant::Config.run do |config|
config.vm.define :djangovm do |django_config|
# Every Vagrant virtual environment requires a box to build off of.
django_config.vm.box = "lucid64"
# The url from where the 'config.vm.box' box will be fetched if it
# doesn't already exist on the user's system.
django_config.vm.box_url = "http://files.vagrantup.com/lucid64.box"
# Forward a port from the guest to the host, which allows for outside
# computers to access the VM, whereas host only networking does not.
django_config.vm.forward_port 80, 8080
django_config.vm.forward_port 8000, 8001
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment