Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Initial Commit.

  • Loading branch information...
commit b08b9e7322230f32c62e503573a576a80635509a 0 parents
Lew Goettner authored
4  .gitignore
... ...
@@ -0,0 +1,4 @@
  1
+.vagrant
  2
+.DS_Store
  3
+cookbooks
  4
+tmp
28  Cheffile
... ...
@@ -0,0 +1,28 @@
  1
+#!/usr/bin/env ruby
  2
+#^syntax detection
  3
+
  4
+site 'http://community.opscode.com/api/v1'
  5
+
  6
+cookbook 'apt'
  7
+cookbook 'subversion'
  8
+
  9
+# Install from github for library fix 
  10
+# https://github.com/opscode-cookbooks/windows/commit/baafddda3f24c0c74d5999bfa2e0812b10ac58dd
  11
+cookbook 'windows',
  12
+  :git => 'https://github.com/opscode-cookbooks/windows'
  13
+
  14
+# We'll use the latest and greatest branch
  15
+cookbook 'wordpress',
  16
+  :git => 'https://github.com/lewg/chef-wordpress',
  17
+  :ref => 'all-the-things'
  18
+
  19
+# cookbook 'chef-client'
  20
+
  21
+# cookbook 'apache2', '>= 1.0.0'
  22
+
  23
+# cookbook 'rvm',
  24
+#   :git => 'https://github.com/fnichol/chef-rvm'
  25
+
  26
+# cookbook 'postgresql',
  27
+#   :git => 'https://github.com/findsyou/cookbooks',
  28
+#   :ref => 'postgresql-improvements'
44  Cheffile.lock
... ...
@@ -0,0 +1,44 @@
  1
+SITE
  2
+  remote: http://community.opscode.com/api/v1
  3
+  specs:
  4
+    apache2 (1.1.8)
  5
+    apt (1.4.2)
  6
+    build-essential (1.0.0)
  7
+    chef_handler (1.0.6)
  8
+    mysql (1.2.4)
  9
+      openssl (>= 0.0.0)
  10
+    openssl (1.0.0)
  11
+    php (1.0.2)
  12
+      build-essential (>= 0.0.0)
  13
+      mysql (>= 0.0.0)
  14
+      xml (>= 0.0.0)
  15
+    subversion (1.0.0)
  16
+      apache2 (>= 0.0.0)
  17
+      windows (>= 0.0.0)
  18
+    xml (1.0.2)
  19
+
  20
+GIT
  21
+  remote: https://github.com/lewg/chef-wordpress
  22
+  ref: all-the-things
  23
+  sha: 3b513977c05b3db84932d882fc6879f713ff1c78
  24
+  specs:
  25
+    wordpress (0.8.8)
  26
+      apache2 (>= 0.99.4)
  27
+      mysql (>= 1.0.5)
  28
+      openssl (>= 0.0.0)
  29
+      php (>= 0.0.0)
  30
+
  31
+GIT
  32
+  remote: https://github.com/opscode-cookbooks/windows
  33
+  ref: master
  34
+  sha: 924e460f33620c7da5f72e27ef144da75d943437
  35
+  specs:
  36
+    windows (1.2.12)
  37
+      chef_handler (>= 0.0.0)
  38
+
  39
+DEPENDENCIES
  40
+  apt (>= 0)
  41
+  subversion (>= 0)
  42
+  windows (>= 0)
  43
+  wordpress (>= 0)
  44
+
61  README.md
Source Rendered
... ...
@@ -0,0 +1,61 @@
  1
+Description
  2
+===========
  3
+
  4
+A Virtualbox / Vagrant / Librarian / Chef setup for WordPress development. 
  5
+
  6
+
  7
+Requirements
  8
+------------
  9
+The idea is to provide a lightweight, consistent development environment. We do this by providing just enough instruction that the combination of VirtualBox, Vagrant, Librarian and Chef can handle building and configuring our dev box. So, you'll need those things! Here's the links:
  10
+
  11
+* [VirtualBox](https://www.virtualbox.org/)
  12
+* [Vagrant](http://vagrantup.com) (handles the Chef requirement as well)
  13
+* [Ruby](http://www.ruby-lang.org/en/)
  14
+* [Librarian](https://github.com/applicationsonline/librarian)
  15
+
  16
+
  17
+Instructions
  18
+------------
  19
+
  20
+After cloning the reposity, have librarian-chef install the cookbooks
  21
+
  22
+	librarian-chef install
  23
+
  24
+Bring up your new box.
  25
+
  26
+	vagrant up
  27
+
  28
+Visit your site via IP to complete your install: [http://192.168.33.20](http://192.168.33.20)
  29
+
  30
+
  31
+Advice
  32
+------
  33
+
  34
+What will really make this work for you is tinkering in the `Vagrantfile` definition to meet your development needs. I've made a few changes and additions to the defaults for our specific case of WordPress development.
  35
+
  36
+### Access
  37
+
  38
+I've added a host-only IP of 192.168.33.20. If you plan to run multiple boxes at once, you may want to start changing them. Here's the relevant line:
  39
+
  40
+	config.vm.network :hostonly, "192.168.33.20"
  41
+
  42
+### Shared Folders
  43
+
  44
+I've put commented lines in there for mapping folders into both the plugins and themes folders. Uncomment, adjust to your local paths, `vagrant reload` and your local folders are now being run by the WordPress install in your VM. Look for these lines:
  45
+
  46
+	# Example Theme Mount
  47
+  	# config.vm.share_folder "my-theme", "/var/www/wordress/wp-content/themes/my-theme"
  48
+
  49
+  	# Example Plugin
  50
+  	# config.vm.share_folder "my-plugin", "/var/www/wordpress/wp-content/plugins/my-plugin"
  51
+
  52
+
  53
+### WordPress.org Plugin and Themes
  54
+
  55
+You can specify a list of plugins and/or themes to automatically when the VM comes up. Debug Bar is in there as a default (you are using this for development, right?) but you can add and remove to match your setup. Plugins can be specified by their relative path on WordPress.org (http://http://wordpress.org/extend/plugins/**[PATH]**/). For readability you can also put in the name if it happens to match the URL after it's lowercased, and had spaces swapped for dashes (e.g. 'Debug Bar' becomes 'debug-bar'). A lot of WordPress plugins and themes adhere to that rule. The relevant lines in `Vagrantfile`: 
  56
+
  57
+	# Include the list of plugins you'd like installed
  58
+    "org_plugins" => [ 'Debug Bar' ],
  59
+    # Include the list of themes you'd like installed
  60
+    'org_themes' => [],
  61
+
127  Vagrantfile
... ...
@@ -0,0 +1,127 @@
  1
+# -*- mode: ruby -*-
  2
+# vi: set ft=ruby :
  3
+
  4
+Vagrant::Config.run do |config|
  5
+  # All Vagrant configuration is done here. The most common configuration
  6
+  # options are documented and commented below. For a complete reference,
  7
+  # please see the online documentation at vagrantup.com.
  8
+
  9
+  # Every Vagrant virtual environment requires a box to build off of.
  10
+  config.vm.box = "lucid32"
  11
+
  12
+  # The url from where the 'config.vm.box' box will be fetched if it
  13
+  # doesn't already exist on the user's system.
  14
+  config.vm.box_url = "http://files.vagrantup.com/lucid32.box"
  15
+
  16
+  # Boot with a GUI so you can see the screen. (Default is headless)
  17
+  # config.vm.boot_mode = :gui
  18
+
  19
+  # Assign this VM to a host-only network IP, allowing you to access it
  20
+  # via the IP. Host-only networks can talk to the host machine as well as
  21
+  # any other machines on the same network, but cannot be accessed (through this
  22
+  # network interface) by any external networks.
  23
+  config.vm.network :hostonly, "192.168.33.20"
  24
+
  25
+  # Assign this VM to a bridged network, allowing you to connect directly to a
  26
+  # network using the host's network device. This makes the VM appear as another
  27
+  # physical device on your network.
  28
+  # config.vm.network :bridged
  29
+
  30
+  # Forward a port from the guest to the host, which allows for outside
  31
+  # computers to access the VM, whereas host only networking does not.
  32
+  # config.vm.forward_port 80, 8080
  33
+
  34
+  # Share an additional folder to the guest VM. The first argument is
  35
+  # an identifier, the second is the path on the guest to mount the
  36
+  # folder, and the third is the path on the host to the actual folder.
  37
+  # config.vm.share_folder "v-data", "/vagrant_data", "../data"
  38
+
  39
+  # Example Theme Mount
  40
+  # config.vm.share_folder "my-theme", "/var/www/wordress/wp-content/themes/my-theme"
  41
+
  42
+  # Example Plugin
  43
+  # config.vm.share_folder "my-plugin", "/var/www/wordpress/wp-content/plugins/my-plugin"
  44
+
  45
+  # Enable provisioning with Puppet stand alone.  Puppet manifests
  46
+  # are contained in a directory path relative to this Vagrantfile.
  47
+  # You will need to create the manifests directory and a manifest in
  48
+  # the file base.pp in the manifests_path directory.
  49
+  #
  50
+  # An example Puppet manifest to provision the message of the day:
  51
+  #
  52
+  # # group { "puppet":
  53
+  # #   ensure => "present",
  54
+  # # }
  55
+  # #
  56
+  # # File { owner => 0, group => 0, mode => 0644 }
  57
+  # #
  58
+  # # file { '/etc/motd':
  59
+  # #   content => "Welcome to your Vagrant-built virtual machine!
  60
+  # #               Managed by Puppet.\n"
  61
+  # # }
  62
+  #
  63
+  # config.vm.provision :puppet do |puppet|
  64
+  #   puppet.manifests_path = "manifests"
  65
+  #   puppet.manifest_file  = "base.pp"
  66
+  # end
  67
+
  68
+  # Enable provisioning with chef solo, specifying a cookbooks path, roles
  69
+  # path, and data_bags path (all relative to this Vagrantfile), and adding 
  70
+  # some recipes and/or roles.
  71
+  #
  72
+  config.vm.provision :chef_solo do |chef|
  73
+    chef.cookbooks_path = "cookbooks"
  74
+  #   chef.roles_path = "../my-recipes/roles"
  75
+  #   chef.data_bags_path = "../my-recipes/data_bags"
  76
+  #   chef.add_recipe "mysql"
  77
+  #   chef.add_role "web"
  78
+  #
  79
+
  80
+    chef.add_recipe 'apt'
  81
+    chef.add_recipe "wordpress"
  82
+    chef.add_recipe "wordpress::org_plugins"
  83
+    chef.add_recipe "wordpress::org_themes"
  84
+  
  85
+    
  86
+    
  87
+    chef.json = {
  88
+      # You'll want to change these values if you're paranoid. 
  89
+      'mysql' => {
  90
+        'server_debian_password' => 'jCLTzpYJvBDNR1EzlwnYyX4xt',
  91
+        'server_root_password' => '0JR1qLXJkztAbgOBGNBoLzimU',
  92
+        'server_repl_password' => 'eHPBCSqMu9RrFAYsCkxZuil5s'
  93
+      },
  94
+      "wordpress" => {
  95
+        # Include the list of plugins you'd like installed
  96
+        "org_plugins" => [ 'Debug Bar' ],
  97
+        # Include the list of themes you'd like installed
  98
+        'org_themes' => [],
  99
+        'version' => 'latest'
  100
+      }
  101
+    }
  102
+
  103
+  end
  104
+
  105
+  # Enable provisioning with chef server, specifying the chef server URL,
  106
+  # and the path to the validation key (relative to this Vagrantfile).
  107
+  #
  108
+  # The Opscode Platform uses HTTPS. Substitute your organization for
  109
+  # ORGNAME in the URL and validation key.
  110
+  #
  111
+  # If you have your own Chef Server, use the appropriate URL, which may be
  112
+  # HTTP instead of HTTPS depending on your configuration. Also change the
  113
+  # validation key to validation.pem.
  114
+  #
  115
+  # config.vm.provision :chef_client do |chef|
  116
+  #   chef.chef_server_url = "https://api.opscode.com/organizations/ORGNAME"
  117
+  #   chef.validation_key_path = "ORGNAME-validator.pem"
  118
+  # end
  119
+  #
  120
+  # If you're using the Opscode platform, your validator client is
  121
+  # ORGNAME-validator, replacing ORGNAME with your organization name.
  122
+  #
  123
+  # IF you have your own Chef Server, the default validation client name is
  124
+  # chef-validator, unless you changed the configuration.
  125
+  #
  126
+  #   chef.validation_client_name = "ORGNAME-validator"
  127
+end

0 notes on commit b08b9e7

Please sign in to comment.
Something went wrong with that request. Please try again.