Skip to content

Commit

Permalink
changed name, added Zend framework download and DB creation to defaul…
Browse files Browse the repository at this point in the history
…t site recipe
  • Loading branch information
danblaker committed Mar 21, 2013
1 parent c546e55 commit efde0b9
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Vagrant::Config.run do |config|
# doesn't already exist on the user's system.
config.vm.box_url = "http://files.vagrantup.com/lucid64.box"

config.vm.define :project do |project_config|
config.vm.define :wkr do |project_config|
project_config.vm.forward_port 80, 8080
# config.vm.boot_mode = :gui
# config.vm.share_folder "v-data", "/vagrant_data", "../data"
Expand All @@ -26,15 +26,15 @@ Vagrant::Config.run do |config|
chef.json = {
sites:[
{
name: "zf2app",
docroot: "/vagrant/www/",
server_name: "www.zf2app.dev",
server_aliases: ["www.zf2app.dev"],
name: "wkr",
docroot: "/vagrant/www/wkr/public/",
server_name: "www.wkr.dev",
server_aliases: ["www.wkr.dev"],
},{
name: "debug.zf2app",
name: "debug.wkr",
docroot: "/var/www/webgrind/",
server_name: "debug.zf2app.dev",
server_aliases: ["debug.zf2app.dev"],
server_name: "debug.wkr.dev",
server_aliases: ["debug.wkr.dev"],
}
],
apache:{
Expand Down
18 changes: 18 additions & 0 deletions chef/site-cookbooks/site/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,21 @@
only_if { `/usr/bin/mysql -u root -p#{node[:mysql][:server_root_password]} -D mysql -r -N -e \"SELECT COUNT(*) FROM user where user='myadmin' and host='localhost'"`.to_i == 0 }
ignore_failure true
end

# Download Zend Framework
remote_file "/vagrant/ZendFramework-1.12.3-minimal.tar.gz" do
source "https://packages.zendframework.com/releases/ZendFramework-1.12.3/ZendFramework-1.12.3-minimal.tar.gz"
notifies :run, "bash[install_program]", :immediately
end

# Install Zend Framework
bash "install_program" do
cwd "/vagrant"
code "tar -zxf ZendFramework-1.12.3-minimal.tar.gz"
end

# Create grit DB
execute "grit" do
command "mysql -uroot -p#{node[:mysql][:server_root_password]} -e 'create database if not exists #{name};'"
user 'vagrant'
end

0 comments on commit efde0b9

Please sign in to comment.