Plugins - garlic
Add to favoritesgarlic - lightweight continuous integration for rails using git
This is not a CI server, use cruisecontrol.rb for that. This is a simple set of rake tasks that let you specify a bunch of rails builds to run against, and dependencies to install.
It works by cloning git repos for all your dependencies (so they all must be on git), and then using git to checkout various tags and branches to build your app against.
Example
See it in action by doing this:
git clone git://github.com/ianwhite/inherit_views cd inherit_views rake cruise
This will clone all the required git repos (done only once), set up the target railses (done once), then run the targets.
Notes:
- To run the specs again, you can do rake garlic:run
- To configure the dependencies and targets, take a look at the top level
Rakefile
- inherit_views doesn’t work with 1.2.x, to test this try adding
target '1.2.6', :tag => 'v1.2.6'
in the Rakefile, then running
rake garlic:prepare rake garlic:run
and you’ll see that it fails against 1.2.6
- inherit_views doesn’t work with 1.2.x, to test this try adding
- In this example, the garlic repo has been added using braid, but you could add it with submodules, or just have a completely different repo which does your CI.
Example config
In case you don’t feel like downloading the above repo, here’s the config:
require File.join(File.dirname(__FILE__),'garlic/lib/garlic_tasks')
garlic do
# repo, give a url, and optional branch
repo 'rails', :url => 'git://github.com/rails/rails'
repo 'rspec', :url => 'git://github.com/dchelimsky/rspec'
repo 'rspec-rails', :url => 'git://github.com/ianwhite/rspec-rails'
repo 'inherit_views', :url => '.'
# for target, default repo is 'rails', default tree is 'master'
target 'edge'
target '2.0-stable', :branch => 'origin/2-0-stable'
target '2.0.2', :tag => 'v2.0.2'
# this stuff applies to all targets
all_targets do
prepare do
plugin 'rspec'
plugin 'inherit_views'
plugin 'rspec-rails', :branch => 'aliased-render-partial' do
sh "script/server rspec -f"
end
end
run do
cd "vendor/plugins/inherit_views" do
sh "rake cruise"
end
end
end
end
First release
This is the first release, so there is plenty of scope for changes and improvement If you want to lend a hand, get in touch.
© Ian White 2008 - ian.w.white@gmail.com MIT Licence
