food_court 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +10 -3
- data/VERSION +1 -1
- data/food_court.gemspec +2 -2
- data/lib/food_court/command.rb +9 -9
- data/spec/command_spec.rb +11 -2
- data/stacks/nginx-passenger-ree/order.rb +4 -3
- metadata +4 -4
data/README.rdoc
CHANGED
@@ -1,17 +1,24 @@
|
|
1
1
|
= Food Court
|
2
2
|
|
3
|
-
Food Court is a streamlined way to use chef-solo and capistrano for VPS's such as slicehost.
|
3
|
+
Food Court is a streamlined way to use chef-solo and capistrano for VPS's such as slicehost. Setup a new slice in 15 minutes or less.
|
4
4
|
|
5
5
|
= Instructions
|
6
|
+
* install the gem
|
7
|
+
gem install food_court
|
6
8
|
* cd into your project
|
7
9
|
food-court init
|
8
10
|
* add your root user, password, and host to config/chef/bootstrap.rb for bootstrapping your slice
|
9
11
|
* setup your slice for chef
|
10
12
|
food-court bootstrap
|
11
|
-
* modify your order.rb to change any default packages
|
13
|
+
* modify your order.rb to add your desired user name and passwords and change any default packages
|
12
14
|
* then run update to push up your cookbooks and configure the server with chef-solo
|
13
15
|
food-court update
|
14
16
|
|
17
|
+
= Cookbooks
|
18
|
+
* You can provide your own customizations inside of 'site-cookbooks' these get zipped up and pushed to your server. This allows you to override or create more custom recipes for your app.
|
19
|
+
* The default stack uses a base set of cookbooks merged from opscode and 37signals by akitaonrails. They have been stripped down to just the essentials and can be found at http://github.com/gvarela/food_court_cookbooks. You can actually use any cookbooks you would like just change the order.rb to point to your favorite repository.
|
20
|
+
* The food_court_cookbooks repository will be a mirror of recipes that are known to work together on simple apps for hosts such as Slicehost. Feel free to fork it and add your own.
|
21
|
+
|
15
22
|
= Gotchas
|
16
23
|
Since Food Court uses Chef you are bound to run into some Chef specific issues
|
17
24
|
|
@@ -25,8 +32,8 @@ should be
|
|
25
32
|
67.xx.xx.xx my-slice.local my-slice
|
26
33
|
|
27
34
|
= Roadmap
|
35
|
+
* add cucumber features for integration testing
|
28
36
|
* enable rollingback a deployment
|
29
|
-
* add generators for stubbing site-cookbooks in the current project repo
|
30
37
|
* enable setup to accept a remote location for template packages
|
31
38
|
|
32
39
|
== Note on Patches/Pull Requests
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.3
|
data/food_court.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{food_court}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.3"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Gabe Varela"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-12-01}
|
13
13
|
s.default_executable = %q{food-court}
|
14
14
|
s.description = %q{Bootstrap and provision your ubuntu slice with ease}
|
15
15
|
s.email = %q{gvarela@gmail.com}
|
data/lib/food_court/command.rb
CHANGED
@@ -20,9 +20,9 @@ module FoodCourt
|
|
20
20
|
puts "Setting up current directory for #{template} stack"
|
21
21
|
FileUtils.mkdir_p File.join(current_path, 'config/chef')
|
22
22
|
FileUtils.mkdir_p File.join(current_path, 'config/chef/deployments')
|
23
|
+
FileUtils.mkdir_p File.join(current_path, 'config/chef/site-cookbooks')
|
23
24
|
FileUtils.cp File.join(TEMPLATE_PATH, template, 'order.rb'), File.join(current_path, 'config/chef', 'order.rb')
|
24
25
|
FileUtils.cp File.join(TEMPLATE_PATH, template, 'bootstrap.rb'), File.join(current_path, 'config/chef', 'bootstrap.rb')
|
25
|
-
FileUtils.cp_r File.join(TEMPLATE_PATH, template, 'site-cookbooks'), File.join(current_path, 'config/chef/site-cookbooks')
|
26
26
|
end
|
27
27
|
|
28
28
|
def bootstrap( bootstrap_file = nil )
|
@@ -53,14 +53,14 @@ module FoodCourt
|
|
53
53
|
def create_cookbook(name, dir=current_path)
|
54
54
|
raise "Must provide a name" unless name
|
55
55
|
puts "** Creating cookbook #{name}"
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
unless File.exists?(File.join(dir, name, "recipes", "default.rb"))
|
63
|
-
open(File.join(dir, name, "recipes", "default.rb"), "w") do |file|
|
56
|
+
FileUtils.mkdir_p File.join(dir, 'config/chef/site-cookbooks', name, "attributes")
|
57
|
+
FileUtils.mkdir_p File.join(dir, 'config/chef/site-cookbooks', name, "recipes")
|
58
|
+
FileUtils.mkdir_p File.join(dir, 'config/chef/site-cookbooks', name, "definitions")
|
59
|
+
FileUtils.mkdir_p File.join(dir, 'config/chef/site-cookbooks', name, "libraries")
|
60
|
+
FileUtils.mkdir_p File.join(dir, 'config/chef/site-cookbooks', name, "files", "default")
|
61
|
+
FileUtils.mkdir_p File.join(dir, 'config/chef/site-cookbooks', name, "stacks", "default")
|
62
|
+
unless File.exists?(File.join(dir, 'config/chef/site-cookbooks', name, "recipes", "default.rb"))
|
63
|
+
File.open(File.join(dir, 'config/chef/site-cookbooks', name, "recipes", "default.rb"), "w") do |file|
|
64
64
|
file.puts <<-EOH
|
65
65
|
#
|
66
66
|
# Cookbook Name:: #{name}
|
data/spec/command_spec.rb
CHANGED
@@ -16,8 +16,6 @@ describe "FoodCourt::Command" do
|
|
16
16
|
|
17
17
|
it "should create a chef/site-cookbooks directory" do
|
18
18
|
File.directory?(File.join(@path, 'config/chef/site-cookbooks')).should be_true
|
19
|
-
File.directory?(File.join(@path, 'config/chef/site-cookbooks/applications')).should be_true
|
20
|
-
File.directory?(File.join(@path, 'config/chef/site-cookbooks/applications/recipes')).should be_true
|
21
19
|
end
|
22
20
|
|
23
21
|
it "should create a chef/deployments directory" do
|
@@ -29,5 +27,16 @@ describe "FoodCourt::Command" do
|
|
29
27
|
File.file?(order_path).should be_true
|
30
28
|
File.read(order_path).should_not be_empty
|
31
29
|
end
|
30
|
+
|
31
|
+
context "#create_cookbooks" do
|
32
|
+
before do
|
33
|
+
@command = FoodCourt::Command.new('create_cookbook', 'sample')
|
34
|
+
end
|
35
|
+
|
36
|
+
it "should create a stub cookbook" do
|
37
|
+
File.directory?(File.join(@path, 'config/chef/site-cookbooks/sample')).should be_true
|
38
|
+
end
|
39
|
+
end
|
32
40
|
end
|
41
|
+
|
33
42
|
end
|
@@ -4,7 +4,8 @@ application = "my-application"
|
|
4
4
|
domain = "my-application.com"
|
5
5
|
# user you want to create for deployments
|
6
6
|
user = :deploy
|
7
|
-
|
7
|
+
# password for the use needs to be a hash use openssl to generate
|
8
|
+
# openssl passwd -1
|
8
9
|
user_password_hash = "..."
|
9
10
|
# your public ssh key
|
10
11
|
user_ssh_key = "ssh-rsa ... ==email@example.com"
|
@@ -65,9 +66,9 @@ mysql_root_password = "..."
|
|
65
66
|
{:name => 'bundler'}
|
66
67
|
],
|
67
68
|
|
68
|
-
|
69
|
+
:pkgs => [
|
69
70
|
# {:name => 'wget'}
|
70
|
-
|
71
|
+
],
|
71
72
|
|
72
73
|
:apps => [
|
73
74
|
{
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: food_court
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 29
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 3
|
10
|
+
version: 0.1.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Gabe Varela
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-12-01 00:00:00 -07:00
|
19
19
|
default_executable: food-court
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|