diff options
author | Andre Arko <andre@arko.net> | 2012-12-08 10:14:53 -0800 |
---|---|---|
committer | Andre Arko <andre@arko.net> | 2012-12-29 14:09:19 -0800 |
commit | 399d900ee85953fa9af6333e15ce8e92dfdcf813 (patch) | |
tree | bc2c4b8ea941c23fc475d8be18255d5729fa460d /Rakefile | |
parent | 9aa6343378d2241dffc7c20b8f1bbd037d9dce49 (diff) | |
download | bundler-399d900ee85953fa9af6333e15ce8e92dfdcf813.tar.gz |
centralize travis setup into a rake task
Conflicts:
.travis.yml
Diffstat (limited to 'Rakefile')
-rw-r--r-- | Rakefile | 16 |
1 files changed, 13 insertions, 3 deletions
@@ -127,6 +127,19 @@ begin task "rubygems:all" => "co" end + namespace :travis do + task :deps do + # Give the travis user a name so that git won't fatally error + system("sudo sed -i 's/1000::/1000:Travis:/g' /etc/passwd") + # Strip secure_path so that RVM paths transmit through sudo -E + system("sudo sed -i '/secure_path/d' /etc/sudoers") + # Install groff for the ronn gem + system("sudo apt-get install groff -y") + # Install the other gem deps, etc. + Rake::Task["spec:deps"].invoke + end + end + desc "Run the tests on Travis CI against a rubygem version (using ENV['RGV'])" task :travis do rg = ENV['RGV'] || 'master' @@ -137,9 +150,6 @@ begin Rake::Task["spec:rubygems:#{rg}"].reenable puts "\n\e[1;33m[Travis CI] Running bundler sudo specs against rubygems #{rg}\e[m\n\n" - # fix the sudoers file so that RVM paths transmit through sudo -E - system("sudo sed -i '/secure_path/d' /etc/sudoers") - # run the sudo specs themselves sudos = system("sudo -E rake spec:rubygems:#{rg}:sudo") # clean up by chowning the newly root-owned tmp directory back to the travis user system("sudo chown -R #{ENV['USER']} #{File.join(File.dirname(__FILE__), 'tmp')}") |