Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

improved build script

  • Loading branch information...
commit 6f24bec70589dee1072ffb545a8e0eda99d7f95d 1 parent 80854da
@mislav authored
Showing with 13 additions and 3 deletions.
  1. +13 −3 test/ci.rb
View
16 test/ci.rb
@@ -11,6 +11,11 @@ def rails_version(gemfile)
gemfile =~ /\d[\d.]*$/ ? $& : '2.3'
end
+def system(*args)
+ puts "$ #{args.join(' ')}"
+ super
+end
+
if ENV['TRAVIS']
if run_mysql
system "mysql -e 'create database will_paginate;' >/dev/null"
@@ -26,20 +31,25 @@ def rails_version(gemfile)
ruby19 = RUBY_VERSION > '1.9'
ruby19_gemfiles = gemfiles.first
-bundler_options = ENV['TRAVIS'] ? '--path vendor/bundle' : ''
+bundler_options = ENV['TRAVIS'] ? "--path #{Dir.pwd}/vendor/bundle" : ''
failed = false
gemfiles.each do |gemfile|
next if ruby19 and !ruby19_gemfiles.include? gemfile
+ version = rails_version(gemfile)
ENV['BUNDLE_GEMFILE'] = gemfile
- if system %(bundle install #{bundler_options})
+ skip_install = gemfile == gemfiles.first
+ if skip_install or system %(bundle install #{bundler_options})
for db in databases
next if 'mysql' == db and !run_mysql
- announce "Rails #{rails_version(gemfile)}", "with #{db}"
+ announce "Rails #{version}", "with #{db}"
ENV['DB'] = db
failed = true unless system %(bundle exec rake)
end
+ else
+ # bundle install failed
+ failed = true
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.