Skip to content

Commit

Permalink
Setup for the new project. Add a Cheffile for use with librarian-chef,
Browse files Browse the repository at this point in the history
add Vagrantfile, fill in the README a bit, add needed cookbook to get
started and have GAE SDK installed in the development vm.
  • Loading branch information
dcharbon committed Apr 9, 2013
1 parent 29d03e6 commit 88a5a70
Show file tree
Hide file tree
Showing 7 changed files with 112 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.*.swp
cookbooks
.vagrant
Cheffile.lock
tmp
7 changes: 7 additions & 0 deletions Cheffile
Original file line number Diff line number Diff line change
@@ -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"
26 changes: 26 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -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!
37 changes: 37 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions site-cookbooks/ggrc/attributes/default.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
default[:ggrc] = {
:app_engine_version => "1.7.6"
}
7 changes: 7 additions & 0 deletions site-cookbooks/ggrc/metadata.rb
Original file line number Diff line number Diff line change
@@ -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"
27 changes: 27 additions & 0 deletions site-cookbooks/ggrc/recipes/default.rb
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 88a5a70

Please # to comment.