Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 143 lines (85 sloc) 4.437 kB
77848bb @ianwhite Move README
authored
1 = garlic
2
3 <b>lightweight continuous integration for rails using git</b>
4
5 This is not a CI server, use cruisecontrol.rb or integrity for that. This is a simple set
6 of commands (or rake tasks) that let you specify a bunch of rails builds to run against, and
7 dependencies to install.
8
9 This is aimed at testing plugins (or apps) against multiple versions of rails,
10 and allows specifying other plugin dependencies (and their versions and any
11 setup requried).
12
13 If you want to run your specs (or whatever) against different versions of gems
14 that you have installed, then check out {ginger}[http://github.com/freelancing-god/ginger] by {Pat Allen}[http://github.com/freelancing-god]
15
16 Garlic works by cloning git repos for all your dependencies (so they all must be
17 git repos), and then using git to checkout various tags and branches to build
18 your app against.
19
20 Here's an example of running a plugin against 3 different rails verisons and 3 different rspec versions: {gist 28786}[http://gist.github.com/28786]
21
22 == It's still new, and not shiny yet
23
24 Please feel free to make it shinier. I'm successfully using it on most of my plugins, and I test
25 with rspec and cucumber.
26
27 Check out the {TODO LIST}[http://github.com/ianwhite/garlic/tree/master/Todo.txt]
28
29 == Get up and running quickly
30
31 You have a plugin and you want it tested against different versions of rails?
32
33 <b>1.</b> install garlic as a gem (see below)
34
35 <b>2.</b> cd into your (say, rspec tested) plugin directory
36
37 garlic generate rspec > garlic.rb
38 garlic install_repos
39 garlic
40
41 <b>3.</b> See what happens, edit garlic.rb to change rails versions and other stuff.
42
43 garlic --help # will probably help
44
45 == Installing
46
47 Install the garlic gem
48
49 # from rubyforge or gemcutter
50 sudo gem install garlic
51
52 # from github
53 sudo gem install ianwhite-garlic --source=http://gems.github.com
54
55 (if you want the very latest version)
56
57 git clone git://github.com/ianwhite/garlic
58 cd garlic
59 rake package
60 sudo gem install pkg/garlic-<code>*</code>.gem
61
62 == Example
63
64 To see garlic in action, download resources_controller_, a rails plugin that uses garlic for CI.
65
66 git clone git://github.com/ianwhite/resources_controller
67
68
69 run garlic
70
71 garlic all
72
73 This will clone all the required git repos (done only once), set up the target railses (done once), then run the targets.
74
75 === Once you've committed some changes
76
77 You can prepare and run all the targets again (without fetching remote repos) by doing
78
79 garlic
80
81 This will prepare all the targets, using the current HEAD of the repos, and run the
82 CI task again.
83
84 === Specifying particular targets
85
86 If you just want to run against a particular target or targets, you can use the -t option,
87 or if using Rake, the TARGET or TARGETS env var.
88
89 garlic -t edge
90
91 == Running Shell commands across multiple targets
92
93 Check dis out
94
95 garlic shell # {Example output}[http://gist.github.com/28795]
96
97 You can pipe any thing into garlic shell and it will execute across all of your garlic targets
98
99 == Rake tasks
100
101 If you prefer to use garlic via rake tasks, then just require 'garlic/tasks' and you'll get a bunch of em.
102 Once required, do rake -T to see descriptions.
103
104 == garlic workflow shell commands
105
106 If you add the following line to your .profile
107
108 source `garlic --path`/sh/garlic.sh
109
110 Then you'll get these 4 new shell commands:
111
112 gcd [target] cds into the specified target working repo
113 gcdp [target] cds into the specified target plugin in the working repo
114 gup cds back up to the garlic'd repo from within a working path
115 gpush [branch] from within a working repo, pushes changes back to the local garlic target, and resets
116 local changes in that target to HEAD.
117
118 This means you might have a workflow as follows (example is for a plugin):
119
120 # run garlic, see probs in '2-2-stable'
121
122 gcdp 2-2 # => takes you into the working repo in the '2-2-stable' target
123
124 # fix the changes, make some commits
125
126 gpush # => pushes the changes back to the enclosing garlic'd repo
127 gup # => go back up there
128 garlic # => rerun garlic to see how the changes affect the other targets
129
130 == Lend a hand
131
132 This is an early release, so there is plenty of scope for changes and improvement
133 If you want to lend a hand, get in touch.
134
135 (c) Ian White 2008-2009 - ian.w.white@gmail.com
136 MIT Licence
137
138 == Lent a hand
139
140 Thanks very much to:
141
142 * Pat Allan
143 * Dr Nic Williams (API suggestions)
Something went wrong with that request. Please try again.