Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 148 lines (85 sloc) 5.563 kb
fd83ce7 @michaelklishin Initial commit
authored
1 # What is Travis Sous Chef
2
a2843eb Edited README.md via GitHub
Michael Klishin authored
3 Travis Sous Chef is a repository that makes development and testing of [Chef](http://www.opscode.com/chef/) cookbooks (for [Travis CI](http://travis-ci.org) but
e776b5b @michaelklishin Explain how Sous Chef came to be and what's the development process like
authored
4 not just) easy. It brings practices that the [Travis Development Team](https://github.com/travis-ci) uses to develop
bead0d2 @michaelklishin README updates to reflect recent travis-ci/travis-cookbooks changes
authored
5 new and test modified [cookbooks](https://github.com/travis-ci/travis-cookbooks/tree/master/ci_environment) for
e776b5b @michaelklishin Explain how Sous Chef came to be and what's the development process like
authored
6 [Travis CI](http://travis-ci.org) to the masses.
fd83ce7 @michaelklishin Initial commit
authored
7
703c905 Edited README.md via GitHub
Michael Klishin authored
8 Sous Chef intentionally focuses on automating away as many distractions as possible so you can focus on developing your Chef cookbooks. It does just one thing but does it well.
a2843eb Edited README.md via GitHub
Michael Klishin authored
9
fd83ce7 @michaelklishin Initial commit
authored
10
e776b5b @michaelklishin Explain how Sous Chef came to be and what's the development process like
authored
11 ## How it works
12
bead0d2 @michaelklishin README updates to reflect recent travis-ci/travis-cookbooks changes
authored
13 With Sous Chef, you use Vagrant and a locally running VirtualBox VM to develop and test your cookbooks. Sous Chef can use any collection of cookbooks: [those we use for travis-ci.org](https://github.com/travis-ci/travis-cookbooks/tree/master/ci_environment), cookbooks you are using for
279d8a5 Edited README.md via GitHub
Michael Klishin authored
14 commercial projects, cookbooks from the [official OpsCode repository](http://github.com/opscode/cookbooks) or anything else.
e776b5b @michaelklishin Explain how Sous Chef came to be and what's the development process like
authored
15
16 With Sous Chef, you provision a locally running virtual machine managed by [Vagrant](http://vagrantup.com) in just one command. The process is
17 set up to shorten the feedback loop:
18
19 * Modify your cookbook recipes (or templates/files in them)
20 * Run provisioning
21 * See and verify the result
22 * Rinse and repeat
23
24 Once you are done with your cookbooks, just push them to a source control repository or rsync them to your server. Then destroy VM environment
25 you were using in one command. Or just power off the VM and come back to work with it later.
26
27
279d8a5 Edited README.md via GitHub
Michael Klishin authored
28 ## Dependencies
29
30 Sous Chef uses [Vagrant](http://vagrantup.com) and thus relies on [Virtual Box](http://virtualbox.org) being installed. Note that you do not
31 need to have Chef installed locally. It will only be run in a virtual machine.
32
33
fd83ce7 @michaelklishin Initial commit
authored
34 ## Getting started with Sous Chef
35
ed1b5f4 travis-ci.org now uses VirtualBox 4.1.8
Michael Klishin authored
36 First install [VirtualBox 4.1.x](https://www.virtualbox.org/wiki/Downloads):
fd83ce7 @michaelklishin Initial commit
authored
37
f27ab5d Update README.md
Michael Klishin authored
38 * For [Mac OS X](http://download.virtualbox.org/virtualbox/4.1.12/VirtualBox-4.1.12-77245-OSX.dmg)
39 * For [64-bit Linux distributions](http://download.virtualbox.org/virtualbox/4.1.12/)
fd83ce7 @michaelklishin Initial commit
authored
40
2dead8d @michaelklishin Update README.md
authored
41 Then [install Vagrant](http://www.vagrantup.com/downloads.html).
fd83ce7 @michaelklishin Initial commit
authored
42
43 Copy sample Vagrant file:
44
45 cp Vagrantfile.sample Vagrantfile
46
42cafc7 Update README.md
Michael Klishin authored
47 Create a cookbooks directory or clone an existing collection of cookbooks like [Travis CI cookbooks](https://github.com/travis-ci/travis-cookbooks):
fd83ce7 @michaelklishin Initial commit
authored
48
49 mkdir cookbooks
50 # or
51 git clone git://github.com/travis-ci/travis-cookbooks.git cookbooks
52
73693fc Comment out provisioning block and update readme.
Chris Harper authored
53 To allow provisioning with chef you need to uncomment the following line
54 (including its associated end statement)
55
56 config.vm.provision :chef_solo do |chef|
57
58
fd83ce7 @michaelklishin Initial commit
authored
59 After that point Vagrant at the cookbooks location by editing Vagrantfile. For Travis CI cookbooks, you just need to uncomment
60
882d329 Update README.md
Michael Klishin authored
61 # this assumes you have travis-ci/travis-cookbooks cloned at ./cookbooks
62 chef.cookbooks_path = ["cookbooks/ci_environment"]
fd83ce7 @michaelklishin Initial commit
authored
63
af9a90a @michaelklishin Update sample Vagrantfile and README to use multiple cookbook locations
authored
64 for other cookbook collections, provide a local path (or several) like so
fd83ce7 @michaelklishin Initial commit
authored
65
af9a90a @michaelklishin Update sample Vagrantfile and README to use multiple cookbook locations
authored
66 chef.cookbooks_path = ["cookbooks"]
fd83ce7 @michaelklishin Initial commit
authored
67
882d329 Update README.md
Michael Klishin authored
68 You can use multiple cookbook locations if necessary.
69 For example, to develop both shared OSS cookbooks and your private product/company-specific ones:
70
71 chef.cookbooks_path = ["cookbooks/ci_environment", "megacorp/cookbooks"]
72
fd83ce7 @michaelklishin Initial commit
authored
73 Next choose some cookbooks to provision. In the case of Travis CI cookbooks, build-essential is a good one to start with, so uncomment
74
75 # chef.add_recipe "build-essential"
76
77 Your Vagrantfile then will look like this:
78
79 Vagrant::Config.run do |config|
74ed903 Make VM name match box arch
Michael Klishin authored
80 config.vm.box = "precise64_base"
d46397e Don't link to files.travis-ci.org which is long gone
Michael Klishin authored
81 config.vm.box_url = "http://files.vagrantup.com/precise64.box"
fd83ce7 @michaelklishin Initial commit
authored
82
83 config.vm.provision :chef_solo do |chef|
84 # point Vagrant at the location of cookbooks you are going to use,
85 # for example, a clone of your fork of github.com/travis-ci/travis-cookbooks
bead0d2 @michaelklishin README updates to reflect recent travis-ci/travis-cookbooks changes
authored
86 chef.cookbooks_path = ["cookbooks/ci_environment"]
fd83ce7 @michaelklishin Initial commit
authored
87
88 # Turn on verbose Chef logging if necessary
89 # chef.log_level = :debug
90
91 # List the recipies you are going to work on/need.
92 chef.add_recipe "build-essential"
93 # chef.add_recipe "networking_basic"
94 # chef.add_recipe "kerl"
95
96 # chef.json.merge!({
97 # :kerl => {
98 # :user => "vagrant",
99 # :group => "vagrant"
100 # }
101 # })
102 end
103 end
104
42cafc7 Update README.md
Michael Klishin authored
105
b3c08a1 Not necessary 32 bit, yo
Michael Klishin authored
106 Create an Ubuntu virtual machine you will be developing cookbooks in:
42cafc7 Update README.md
Michael Klishin authored
107
108 vagrant up
109
110 To provision the VM ("provisioning" means running chef-solo to converge the VM to the state you want using Chef recipes you'd chosen to use):
fd83ce7 @michaelklishin Initial commit
authored
111
112 vagrant provision
113
114
115 Running chef-solo may take from several seconds to several minutes, dependeing on what selected recipes do. Building 13 Ruby versions/implementations
f27ab5d Update README.md
Michael Klishin authored
116 for travis-ci.org, for example, takes over 50 minutes but most of recipes run in under 30 seconds.
fd83ce7 @michaelklishin Initial commit
authored
117
8e9a866 @michaelklishin Describe a few more workflow steps
authored
118 Once provisioning finishes, ssh into the VM to check what the environment looks like:
119
120 vagrant ssh
121
122 When you are done with your work on the cookbook you can either power off the VM to use it later with
123
124 vagrant halt
125
126 or destroy it completely with
127
128 vagrant destroy
129
fd83ce7 @michaelklishin Initial commit
authored
130
131 ## Developing a new cookbook with Sous Chef
132
133 TBD
134
135
136 ## Copyright
137
7720176 @michaelklishin Update (c) year
authored
138 Michael S. Klishin & Travis CI Development Team, 2011-2014
fd83ce7 @michaelklishin Initial commit
authored
139
140
141 ## License
142
143 The MIT license. See LICENSE file in the repository root.
e424dbb @bitdeli-chef Add a Bitdeli badge to README
bitdeli-chef authored
144
145
146 [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/michaelklishin/sous-chef/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
147
Something went wrong with that request. Please try again.