Permalink
Browse files

Refactor CI task

  • Loading branch information...
jakedouglas committed Mar 27, 2010
1 parent 5309860 commit bffc397d152b548a6cd574480cb0b3cf10b4a781
Showing with 21 additions and 33 deletions.
  1. +21 −33 Rakefile
View
@@ -8,7 +8,27 @@ task :spec do
end
task :default => :spec
-task :ci_spec do
+# Should be used like:
+# rake --trace ci[1.8.7,shared]
+
+task :ci, [:ruby_type, :lib_option] do |t, args|
+ ruby_type, lib_option = args[:ruby_type], args[:lib_option]
+ raise "#{ruby_type} is not a supported ruby version" unless ["1.8.6", "1.8.7", "ree"].include?(ruby_type)
+ raise "#{lib_option} is not a supported " unless ["shared", "static"].include?(lib_option)
+
+ lib_option = case lib_option
+ when "static"
+ "--disable-shared"
+ when "shared"
+ "--enable-shared"
+ end
+
+ sh "/usr/bin/env bash -c \"
+ source ~/.rvm/scripts/rvm &&
+ rvm install #{ruby_type} --reconfigure -C #{lib_option} &&
+ rvm #{ruby_type} --symlink memprof &&
+ memprof_gem install bacon\""
+
Dir.chdir('ext') do
sh '/usr/bin/env bash -c "make clean"' rescue nil
sh "~/.rvm/bin/memprof_ruby extconf.rb"
@@ -17,35 +37,3 @@ task :ci_spec do
sh "~/.rvm/bin/memprof_ruby spec/memprof_spec.rb"
end
-task :mri_x86_64_shared do
- sh '/usr/bin/env bash -c "
- source ~/.rvm/scripts/rvm &&
- rvm install 1.8.7 --reconfigure -C --enable-shared &&
- rvm 1.8.7 --symlink memprof"'
- Rake::Task[:ci_spec].invoke
-end
-
-task :mri_x86_64_static do
- sh '/usr/bin/env bash -c "
- source ~/.rvm/scripts/rvm &&
- rvm install 1.8.7 --reconfigure -C --disable-shared &&
- rvm 1.8.7 --symlink memprof"'
- Rake::Task[:ci_spec].invoke
-end
-
-task :ree_x86_64_shared do
- sh '/usr/bin/env bash -c "
- source ~/.rvm/scripts/rvm &&
- rvm install ree --reconfigure -C --enable-shared &&
- rvm ree --symlink memprof"'
- Rake::Task[:ci_spec].invoke
-end
-
-task :ree_x86_64_static do
- sh '/usr/bin/env bash -c "
- source ~/.rvm/scripts/rvm &&
- rvm install ree --reconfigure -C --disable-shared &&
- rvm ree --symlink memprof"'
- Rake::Task[:ci_spec].invoke
-end
-

0 comments on commit bffc397

Please sign in to comment.