forked from TwP/webby
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updating rake tasks to the latest version of Mr Bones. These tasks ha…
…ve Git support.
- Loading branch information
Showing
3 changed files
with
52 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,41 @@ | |||
# $Id$ | |||
|
|||
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-%s" % [PROJ.name, 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters