Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 0b533df
Showing
3 changed files
with
65 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
GIT-TAGGER | ||
========== | ||
|
||
Nifty rake tasks to simplify your git tagging. | ||
|
||
How to use | ||
---------- | ||
|
||
Create a Rakefile | ||
require git-tagger | ||
``` ruby | ||
require 'git-tagger' | ||
``` | ||
|
||
It's it. Now you have usefull rake tasks. | ||
To create a new tag. | ||
$ rake tagger | ||
|
||
If you desire to destroy an already created release: | ||
$ rake tagger:rollback | ||
|
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Gem::Specification.new do |s| | ||
s.name = 'git-tagger' | ||
s.version = '0.0.1' | ||
s.date = '2012-08-06' | ||
s.summary = "Nifty rake tasks to simplify your git tagging" | ||
s.description = "Nifty rake tasks to simplify your git tagging" | ||
s.authors = ["Lucas Galego", "Paulo Ragonha"] | ||
s.email = 'lucas@galego.me' | ||
s.files = ["lib/git-tagger.rb"] | ||
s.homepage = 'https://github.com/lrgalego/git-tagger' | ||
end |
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# encoding: utf-8 | ||
|
||
task :tagger => [:'tagger:tag_name', :'tagger:tag'] | ||
|
||
namespace :tagger do | ||
|
||
task :tag_name do | ||
puts "Last tag:" | ||
sh %{git tag | tail -1} | ||
puts "Enter new tag:" | ||
@tag_name = "#{STDIN.gets.to_s.chomp}" | ||
end | ||
|
||
task :tag => :tag_name do | ||
sh %{git checkout -b release-#{@tag_name}} | ||
sh %{git add -f release} | ||
sh %{git commit -m 'release #{@tag_name}'} | ||
sh %{git tag #{@tag_name}} | ||
sh %{git push origin release-#{@tag_name}} | ||
sh %{git push --tags} | ||
sh %{git checkout master} | ||
end | ||
|
||
task :rollback do | ||
puts "Tag to destroy:" | ||
tag_name = "sinatra-#{STDIN.gets.to_s.chomp}" | ||
sh %{git push origin :refs/tags/#{tag_name}} | ||
sh %{git tag -d #{tag_name}} | ||
sh %{git push origin :release-#{tag_name}} | ||
sh %{git branch -D release-#{tag_name}} | ||
end | ||
|
||
end |