Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

34 lines (30 sloc) 1.229 kB
BUNDLER_VERSION="1.0.7"
import 'init_testbed.rakefile'
namespace :bundle do
task :ensure_bundler_available do
`gem list -i bundler -v '=#{BUNDLER_VERSION}'`
unless $? == 0
puts bordered_message("Installing bundler #{BUNDLER_VERSION}")
system("gem install bundler -v '=#{BUNDLER_VERSION}' --no-ri --no-rdoc")
unless $? == 0
fail bordered_message("Install failed.\nPlease fix the problem and try again or manually install bundler #{BUNDLER_VERSION}.")
end
end
end
def bordered_message(msg)
len = msg.split("\n").collect { |l| l.size }.max
['=' * len, msg, '=' * len].join("\n")
end
end
namespace :ci do
task :generate_testbed_for_hudson => [:'testbed:remove', :'testbed:generate'] do
# Hudson
chdir("testbed") do
database_yml = File.read('config/database.yml') + "\n\nhudson:\n <<: *test\n"
File.open('config/database.yml', 'w'){|f| f.write database_yml}
sh "cp config/environments/cucumber.rb config/environments/hudson.rb"
end
end
task :setup_testbed_for_hudson => [:'testbed:setup', :'testbed:migrate']
end
task :default => [:'bundle:ensure_bundler_available', :'ci:generate_testbed_for_hudson', :'ci:setup_testbed_for_hudson']
Jump to Line
Something went wrong with that request. Please try again.