Skip to content

Commit

Permalink
Updated to use new garlic gem style for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ianwhite committed Nov 25, 2008
1 parent 1c3f1e8 commit cc0710f
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 77 deletions.
3 changes: 1 addition & 2 deletions .gitignore
@@ -1,3 +1,2 @@
garlic.rb
garlic
.garlic
doc/*
1 change: 0 additions & 1 deletion README

This file was deleted.

2 changes: 1 addition & 1 deletion README.rdoc
Expand Up @@ -86,7 +86,7 @@ The first two has_manys of Author are plain vanilla, the last four are what this

== What does it run on?

Currently it's running on edge, 2.0-stable and 2.1-stable
Currently it's running on 2.0, 2.1, and 2.2 stable branches

If you want to run the CI suite, then check out garlic_example.rb (The CI suite
is being cooked with garlic - git://github.com/ianwhite/garlic)
39 changes: 9 additions & 30 deletions Rakefile
Expand Up @@ -10,28 +10,6 @@ plugin_name = 'nested_has_many_through'

task :default => :spec

task :cruise do
# run the garlic task, capture the output, if succesful make the docs and copy them to ardes
begin
sh "rake garlic:all > garlic_report.txt"

# send abridged rpeort
report = File.read('garlic_report.txt').sub(/^.*?==========/m, '==========')
report = "garlic report for #{plugin_name}\n#{`git log -n 1 --pretty=oneline --no-color`}\n" + report
File.open('garlic_report.txt', 'w+') {|f| f << report }
sh "scp -i ~/.ssh/ardes garlic_report.txt ardes@ardes.com:~/subdomains/plugins/httpdocs/doc/#{plugin_name}_garlic_report.txt"

# build doc and send that
cd "garlic/work/edge/vendor/plugins/#{plugin_name}" do
sh "rake doc:all"
sh "scp -i ~/.ssh/ardes -r doc ardes@ardes.com:~/subdomains/plugins/httpdocs/doc/#{plugin_name}"
end

ensure
puts File.read('garlic_report.txt')
end
end

desc "Run the specs for #{plugin_name}"
Spec::Rake::SpecTask.new(:spec) do |t|
t.spec_files = FileList['spec/**/*_spec.rb']
Expand Down Expand Up @@ -89,13 +67,14 @@ namespace :doc do
task :all => ["spec:doc:html", "spec:doc", "spec:rcov", "doc"]
end

# load up garlic if it's here
if File.directory?(File.join(File.dirname(__FILE__), 'garlic'))
require File.join(File.dirname(__FILE__), 'garlic/lib/garlic_tasks')
require File.join(File.dirname(__FILE__), 'garlic')
end

desc "clone the garlic repo (for running ci tasks)"
task :get_garlic do
sh "git clone git://github.com/ianwhite/garlic.git garlic"
task :cruise do
# run the garlic task, capture the output, if succesful make the docs and copy them to ardes
sh "garlic clean && mkdir -p .garlic && (garlic all > .garlic/report.txt)"
`scp -i ~/.ssh/ardes .garlic/report.txt ardes@ardes.com:~/subdomains/plugins/httpdocs/doc/#{plugin_name}_garlic_report.txt`
cd ".garlic/2.2-stable/vendor/plugins/#{plugin_name}" do
`rake doc:all`
`scp -i ~/.ssh/ardes -r doc ardes@ardes.com:~/subdomains/plugins/httpdocs/doc/#{plugin_name}`
end
puts "The build is GOOD"
end
26 changes: 26 additions & 0 deletions garlic.rb
@@ -0,0 +1,26 @@
garlic do
repo 'nested_has_many_through', :path => '.'

repo 'rails', :url => 'git://github.com/rails/rails'
repo 'rspec', :url => 'git://github.com/dchelimsky/rspec'
repo 'rspec-rails', :url => 'git://github.com/dchelimsky/rspec-rails'

#target 'edge', :branch => 'origin/master'
target '2.2', :branch => 'origin/2-2-stable'
target '2.1', :branch => 'origin/2-1-stable'
target '2.0', :branch => 'origin/2-0-stable'

all_targets do
prepare do
plugin 'rspec'
plugin('rspec-rails') { `script/generate rspec -f` }
plugin 'nested_has_many_through', :clone => true
end

run do
cd "vendor/plugins/nested_has_many_through" do
sh "rake spec:rcov:verify"
end
end
end
end
43 changes: 0 additions & 43 deletions garlic_example.rb

This file was deleted.

0 comments on commit cc0710f

Please sign in to comment.