Skip to content

Commit

Permalink
Add Vagrant deploy support
Browse files Browse the repository at this point in the history
  • Loading branch information
cnorthwood committed Dec 25, 2012
1 parent 2856f84 commit 5c15af5
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -6,3 +6,4 @@ docs/_build
dist/
.DS_Store
*.egg-info
.vagrant
3 changes: 3 additions & 0 deletions .gitmodules
@@ -0,0 +1,3 @@
[submodule "cookbooks/python"]
path = cookbooks/python
url = https://github.com/opscode-cookbooks/python.git
18 changes: 18 additions & 0 deletions Vagrantfile
@@ -0,0 +1,18 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant::Config.run do |config|
config.vm.box = "precise32"
config.vm.box_url = "http://files.vagrantup.com/precise32.box"

config.vm.network :hostonly, "192.168.33.10"

config.vm.forward_port 80, 8000
config.vm.forward_port 8002, 8002

config.vm.provision :chef_solo do | chef |
chef.add_recipe "python"
chef.add_recipe "molly::develop"
end

end
25 changes: 25 additions & 0 deletions cookbooks/molly/recipes/develop.rb
@@ -0,0 +1,25 @@
molly_user = 'molly'

user molly_user

directory '/opt/molly' do
action :create
owner molly_user
group molly_user
end

python_virtualenv '/opt/molly' do
owner molly_user
group molly_user
action :create
end

bash "Setup Molly" do
cwd '/tmp'
user molly_user
group molly_user
code <<-EOH
/opt/molly/bin/pip install -r /vagrant/requirements.txt
/opt/molly/bin/python /vagrant/setup.py develop
EOH
end
1 change: 1 addition & 0 deletions cookbooks/python
Submodule python added at 34cb92

0 comments on commit 5c15af5

Please sign in to comment.