Rakefile in facter-1.5.2 vs Rakefile in facter-1.5.3

- old
+ new

@@ -25,13 +25,10 @@ 'conf/**/*', 'documentation/**/*', 'etc/*' ] - #p.epmhosts = %w{culain} - #p.rpmhost = "fedora1" - #p.sunpkghost = "sol10b" end project.mkgemtask do |gem| gem.require_path = 'lib' # Use these for libraries. @@ -40,17 +37,64 @@ gem.default_executable = "facter" gem.author = "Luke Kanies" end -if project.has?(:epm) - project.mkepmtask do |task| - task.bins = FileList.new("bin/facter") - task.rubylibs = FileList.new('lib/**/*') - end -end - task :archive do raise ArgumentError, "You must specify the archive name by setting ARCHIVE; e.g., ARCHIVE=1.5.1rc1" unless archive = ENV["ARCHIVE"] sh "git archive --format=tar --prefix=facter-#{archive}/ HEAD | gzip -c > facter-#{archive}.tgz" +end + +namespace :ci do + + desc "Run the CI prep tasks" + task :prep do + require 'rubygems' + gem 'ci_reporter' + require 'ci/reporter/rake/rspec' + require 'ci/reporter/rake/test_unit' + ENV['CI_REPORTS'] = 'results' + end + + desc "Run CI RSpec tests" + task :spec => [:prep, 'ci:setup:rspec'] do + sh "cd spec; rake all; exit 0" + end + +end + +desc "Send patch information to the puppet-dev list" +task :mail_patches do + if Dir.glob("00*.patch").length > 0 + raise "Patches already exist matching '00*.patch'; clean up first" + end + + unless %x{git status} =~ /On branch (.+)/ + raise "Could not get branch from 'git status'" + end + branch = $1 + + unless branch =~ %r{^([^\/]+)/([^\/]+)/([^\/]+)$} + raise "Branch name does not follow <type>/<parent>/<name> model; cannot autodetect parent branch" + end + + type, parent, name = $1, $2, $3 + + # Create all of the patches + sh "git format-patch -C -M -s -n #{parent}..HEAD" + + # And then mail them out. + + # If we've got more than one patch, add --compose + if Dir.glob("00*.patch").length > 1 + compose = "--compose" + else + compose = "" + end + + # Now send the mail. + sh "git send-email #{compose} --no-chain-reply-to --no-signed-off-by-cc --suppress-from --no-thread --to puppet-dev@googlegroups.com 00*.patch" + + # Finally, clean up the patches + sh "rm 00*.patch" end