summaryrefslogtreecommitdiffstats
path: root/ruby-gem/tasks/git.rake
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2011-09-23 08:35:35 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2011-09-23 08:35:35 +0200
commitbf8f95fdd25a68d02598c7be864bc97c05132c90 (patch)
treedfe5cc9752a13d3b6c3bd75e8af2896361abf7bc /ruby-gem/tasks/git.rake
parent4da50a4f3e30d70595807d7debe63f8bbf56bc64 (diff)
downloadskeletons-bf8f95fdd25a68d02598c7be864bc97c05132c90.zip
skeletons-bf8f95fdd25a68d02598c7be864bc97c05132c90.tar.gz
everything is packed into ruby-gems directory
Diffstat (limited to 'ruby-gem/tasks/git.rake')
-rw-r--r--ruby-gem/tasks/git.rake38
1 files changed, 38 insertions, 0 deletions
diff --git a/ruby-gem/tasks/git.rake b/ruby-gem/tasks/git.rake
new file mode 100644
index 0000000..b219923
--- /dev/null
+++ b/ruby-gem/tasks/git.rake
@@ -0,0 +1,38 @@
+# -*- coding: UTF-8 -*-
+#
+if HAVE_GIT
+
+namespace :git do
+
+ # A prerequisites task that all other tasks depend upon
+ task :prereqs
+
+ desc 'Show tags from the Git repository'
+ task :show_tags => 'git:prereqs' do |t|
+ puts %x/git tag/
+ end
+
+ desc 'Create a new tag in the Git repository'
+ task :create_tag => 'git:prereqs' do |t|
+ v = ENV['VERSION'] or abort 'Must supply VERSION=x.y.z'
+ abort "Versions don't match #{v} vs #{PROJ.version}" if v != PROJ.version
+ tag = "%s" % [ PROJ.version ]
+ msg = "Creating tag for #{PROJ.name} version #{PROJ.version}"
+ puts "Creating Git tag '#{tag}'"
+ unless system "git tag -a -m '#{msg}' #{tag}"
+ abort "Tag creation failed"
+ end
+# if %x/git remote/ =~ %r/^origin\s*$/
+# unless system "git push origin #{tag}"
+# abort "Could not push tag to remote Git repository"
+# end
+# end
+ end
+
+end # namespace :git
+
+#task 'gem:release' => 'git:create_tag'
+
+end # if HAVE_GIT
+
+# EOF