From 88a5a70bad2c41db6ca6a9a82d3db4a859ae5c90 Mon Sep 17 00:00:00 2001 From: David Charboneau Date: Mon, 8 Apr 2013 19:12:29 -0700 Subject: [PATCH] Setup for the new project. Add a Cheffile for use with librarian-chef, add Vagrantfile, fill in the README a bit, add needed cookbook to get started and have GAE SDK installed in the development vm. --- .gitignore | 5 +++ Cheffile | 7 +++++ README.rst | 26 ++++++++++++++++ Vagrantfile | 37 +++++++++++++++++++++++ site-cookbooks/ggrc/attributes/default.rb | 3 ++ site-cookbooks/ggrc/metadata.rb | 7 +++++ site-cookbooks/ggrc/recipes/default.rb | 27 +++++++++++++++++ 7 files changed, 112 insertions(+) create mode 100644 .gitignore create mode 100644 Cheffile create mode 100644 Vagrantfile create mode 100644 site-cookbooks/ggrc/attributes/default.rb create mode 100644 site-cookbooks/ggrc/metadata.rb create mode 100644 site-cookbooks/ggrc/recipes/default.rb diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..87c54fa01e8c --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +.*.swp +cookbooks +.vagrant +Cheffile.lock +tmp diff --git a/Cheffile b/Cheffile new file mode 100644 index 000000000000..c03825a0a699 --- /dev/null +++ b/Cheffile @@ -0,0 +1,7 @@ +cookbook "apt", + :git => "https://github.com/cookbooks/apt.git", + :ref => "1.3.2" + +cookbook "build-essential", + :git => "https://github.com/opscode-cookbooks/build-essential.git", + :ref => "1.3.4" diff --git a/README.rst b/README.rst index e69de29bb2d1..cfcae6432766 100644 --- a/README.rst +++ b/README.rst @@ -0,0 +1,26 @@ +**** +GGRC +**** + +Requirements +============ + +* VirtualBox +* Vagrant +* librarian (ruby gem) + +Getting Started +=============== + +* clone the repo +* cwd to the project directory +* run the following: + +.. sourcecode:: bash + librarian-chef install + vagrant up + vagrant ssh + cd /vagrant + ls + +Now you're in and your in the project directory in the VM. Get to work! diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 000000000000..2c7c8212f828 --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,37 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +Vagrant.configure("2") do |config| + config.vm.box = "ggrc" + + # Fetched the box if it doesn't already exist. + config.vm.box_url = "http://files.vagrantup.com/lucid64.box" + + # Create a private network, which allows host-only access to the machine + # using a specific IP. + config.vm.network :private_network, ip: "192.168.33.10" + + # Provider-specific configuration so you can fine-tune various + # backing providers for Vagrant. These expose provider-specific options. + # Example for VirtualBox: + # + # config.vm.provider :virtualbox do |vb| + # # Don't boot with headless mode + # vb.gui = true + # + # # Use VBoxManage to customize the VM. For example to change memory: + # vb.customize ["modifyvm", :id, "--memory", "1024"] + # end + # + # View the documentation for the provider you're using for more + # information on available options. + + # Enable provisioning with chef solo, specifying a cookbooks path, roles + # path, and data_bags path (all relative to this Vagrantfile), and adding + # some recipes and/or roles. + # + config.vm.provision :chef_solo do |chef| + chef.cookbooks_path = ["cookbooks","site-cookbooks"] + chef.add_recipe "ggrc" + end +end diff --git a/site-cookbooks/ggrc/attributes/default.rb b/site-cookbooks/ggrc/attributes/default.rb new file mode 100644 index 000000000000..be9976f34a87 --- /dev/null +++ b/site-cookbooks/ggrc/attributes/default.rb @@ -0,0 +1,3 @@ +default[:ggrc] = { + :app_engine_version => "1.7.6" +} diff --git a/site-cookbooks/ggrc/metadata.rb b/site-cookbooks/ggrc/metadata.rb new file mode 100644 index 000000000000..deb3aa33d139 --- /dev/null +++ b/site-cookbooks/ggrc/metadata.rb @@ -0,0 +1,7 @@ +maintainer "Reciprocity, Inc" +maintainer_email "david@reciprocitylabs.com" +license "Apache 2.0" +description "Installs requirements for GGRC" +version "0.1" +long_description "Installs requirements for GGRC. Rails, etc.." +depends "apt" diff --git a/site-cookbooks/ggrc/recipes/default.rb b/site-cookbooks/ggrc/recipes/default.rb new file mode 100644 index 000000000000..4fb3fae67b79 --- /dev/null +++ b/site-cookbooks/ggrc/recipes/default.rb @@ -0,0 +1,27 @@ +include_recipe "apt" + +package "unzip" do + action :install +end + +version = node[:ggrc][:app_engine_version] +zipfile = "google_appengine_#{version}.zip" + +unless File.exists?("/opt/#{zipfile}") + remote_file "/opt/#{zipfile}" do + source "http://googleappengine.googlecode.com/files/#{zipfile}" + action :create + end + + execute "Unzip Google App Engine SDK" do + command "unzip /opt/#{zipfile}" + cwd "/opt" + action :run + end + + execute "Add Google App Engine SDK to the PATH" do + command "sed -i -e 's/PATH=\"/PATH=\"\\/opt\\/google_appengine:/' /etc/environment" + action :run + end +end +