Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
lrgalego committed Aug 6, 2012
0 parents commit 0b533df
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 0 deletions.
21 changes: 21 additions & 0 deletions README.md
@@ -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

11 changes: 11 additions & 0 deletions git-tagger.gemspec
@@ -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
33 changes: 33 additions & 0 deletions lib/git-tagger.rb
@@ -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

0 comments on commit 0b533df

Please sign in to comment.