[Pkg-puppet-devel] [SCM] Packaging of Facter for debian branch, upstream, updated. 3a39dd8353b6308cf49522990104cc63e55d7cda

James Turnbull james at lovedthanlost.net
Fri Jan 29 17:22:38 UTC 2010


The following commit has been merged in the upstream branch:
commit 7d4a5f921695d9502641e6da36213d912d54df5c
Author: James Turnbull <james at lovedthanlost.net>
Date:   Tue Aug 18 21:34:34 2009 +1000

    Updated Rakefile and moved Rake tasks to tasks/rake directory

diff --git a/Rakefile b/Rakefile
index c02846c..373d92a 100644
--- a/Rakefile
+++ b/Rakefile
@@ -1,6 +1,9 @@
 # Rakefile for facter
 
 $: << File.expand_path('lib')
+$LOAD_PATH << File.join(File.dirname(__FILE__), 'tasks')
+
+Dir['tasks/**/*.rake'].each { |t| load t } 
 
 require './lib/facter.rb'
 require 'rake'
@@ -58,55 +61,3 @@ task :spec do
         t.spec_files = FileList['spec/**/*.rb']
     end 
 end
-
-desc "Prep CI RSpec tests"
-task :ci_prep do
-    require 'rubygems'
-    begin
-        gem 'ci_reporter'
-        require 'ci/reporter/rake/rspec'
-        require 'ci/reporter/rake/test_unit'
-        ENV['CI_REPORTS'] = 'results'
-    rescue LoadError 
-       puts 'Missing ci_reporter gem. You must have the ci_reporter gem installed to run the CI spec tests'
-    end
-end
-
-desc "Run the CI RSpec tests"
-task :ci_spec => [:ci_prep, 'ci:setup:rspec', :spec]
-
-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 --subject-prefix='PATCH/facter' #{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-signed-off-by-cc --suppress-from --to puppet-dev at googlegroups.com 00*.patch"
-
-    # Finally, clean up the patches
-    sh "rm 00*.patch"
-end
diff --git a/tasks/rake/changlog.rake b/tasks/rake/changlog.rake
new file mode 100644
index 0000000..0427e41
--- /dev/null
+++ b/tasks/rake/changlog.rake
@@ -0,0 +1,10 @@
+desc "Create a ChangeLog based on git commits."
+task :changelog do
+    CHANGELOG_DIR = "#{Dir.pwd}"
+    mkdir(CHANGELOG_DIR) unless File.directory?(CHANGELOG_DIR)
+    change_body=`git log --pretty=format:'%aD%n%an <%ae>%n%s%n'`
+    File.open(File.join(CHANGELOG_DIR, "ChangeLog"), 'w') do |f|
+        f << change_body
+    end
+end
+
diff --git a/tasks/rake/ci.rake b/tasks/rake/ci.rake
new file mode 100644
index 0000000..1a79b98
--- /dev/null
+++ b/tasks/rake/ci.rake
@@ -0,0 +1,17 @@
+desc "Prep CI RSpec tests"
+task :ci_prep do
+    require 'rubygems'
+    begin
+        gem 'ci_reporter'
+        require 'ci/reporter/rake/rspec'
+        require 'ci/reporter/rake/test_unit'
+        ENV['CI_REPORTS'] = 'results'
+    rescue LoadError
+       puts 'Missing ci_reporter gem. You must have the ci_reporter gem installed to run the CI spec tests'
+    end 
+end
+
+desc "Run the CI RSpec tests"
+task :ci_spec => [:ci_prep, 'ci:setup:rspec', :spec] do
+    sh "exit 0"
+end
diff --git a/tasks/rake/dailybuild.rake b/tasks/rake/dailybuild.rake
new file mode 100644
index 0000000..709bd48
--- /dev/null
+++ b/tasks/rake/dailybuild.rake
@@ -0,0 +1,9 @@
+desc "Create a Facter daily build"
+task :daily => :changelog do
+  version = "facter" + "-" + Time.now.localtime.strftime("%Y%m%d")
+  sh "git archive --format=tar --prefix=#{version}/ HEAD^{tree} >#{version}.tar"
+  sh "pax -waf #{version}.tar -s ':^:#{version}/:' ChangeLog"
+  sh "rm ChangeLog"
+  sh "gzip -f -9 #{version}.tar"
+end
+
diff --git a/tasks/rake/mail_patches.rake b/tasks/rake/mail_patches.rake
new file mode 100644
index 0000000..6375a22
--- /dev/null
+++ b/tasks/rake/mail_patches.rake
@@ -0,0 +1,35 @@
+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 --subject-prefix='PATCH/facter' #{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-signed-off-by-cc --suppress-from --to puppet-dev at googlegroups.com 00*.patch"
+
+    # Finally, clean up the patches
+    sh "rm 00*.patch"
+end
diff --git a/tasks/rake/metrics.rake b/tasks/rake/metrics.rake
new file mode 100644
index 0000000..63af552
--- /dev/null
+++ b/tasks/rake/metrics.rake
@@ -0,0 +1,6 @@
+begin
+    require 'metric_fu'
+rescue LoadError
+    # Metric-fu not installed
+    # http://metric-fu.rubyforge.org/
+end

-- 
Packaging of Facter for debian



More information about the Pkg-puppet-devel mailing list