forked from LeipeLeon/capistrano-git-tags
-
Notifications
You must be signed in to change notification settings - Fork 2
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
1 parent
ff6551b
commit 5938ecd
Showing
11 changed files
with
145 additions
and
106 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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
== 0.0.3 (October 31, 2011) | ||
|
||
* Added stage to tag name | ||
|
||
== 0.0.1 (May 6, 2010) | ||
|
||
* Inital Check-in |
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,3 @@ | ||
source :gemcutter | ||
|
||
gemspec |
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,29 @@ | ||
PATH | ||
remote: . | ||
specs: | ||
capistrano-tagging (0.0.3) | ||
capistrano (>= 1.0.0) | ||
|
||
GEM | ||
remote: http://rubygems.org/ | ||
specs: | ||
capistrano (2.9.0) | ||
highline | ||
net-scp (>= 1.0.0) | ||
net-sftp (>= 2.0.0) | ||
net-ssh (>= 2.0.14) | ||
net-ssh-gateway (>= 1.1.0) | ||
highline (1.6.2) | ||
net-scp (1.0.4) | ||
net-ssh (>= 1.99.1) | ||
net-sftp (2.0.5) | ||
net-ssh (>= 2.0.9) | ||
net-ssh (2.2.1) | ||
net-ssh-gateway (1.1.0) | ||
net-ssh (>= 1.99.1) | ||
|
||
PLATFORMS | ||
ruby | ||
|
||
DEPENDENCIES | ||
capistrano-tagging! |
This file was deleted.
Oops, something went wrong.
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,27 @@ | ||
Capistrano tagging | ||
==== | ||
|
||
Automagically tag your current deployed release with capistrano | ||
|
||
Install | ||
---- | ||
|
||
gem install capistrano-tagging | ||
|
||
Usage | ||
---- | ||
|
||
in deploy.rb: | ||
|
||
require 'capistrano/tagging' | ||
|
||
set :tag_format, ':rails_env_:release' # by default, also available all of deploy variables | ||
|
||
Original idea: | ||
--- | ||
|
||
* [https://github.com/LeipeLeon/capistrano-git-tags](https://github.com/LeipeLeon/capistrano-git-tags) | ||
|
||
* [http://wendbaar.nl/blog/2010/04/automagically-tagging-releases-in-github/](http://wendbaar.nl/blog/2010/04/automagically-tagging-releases-in-github/) | ||
|
||
* [http://gist.github.com/381852](http://gist.github.com/381852) |
This file was deleted.
Oops, something went wrong.
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,26 @@ | ||
# encoding: utf-8 | ||
require File.expand_path("../lib/capistrano/tagging/version", __FILE__) | ||
|
||
Gem::Specification.new do |s| | ||
s.name = "capistrano-tagging" | ||
s.platform = Gem::Platform::RUBY | ||
s.version = Capistrano::Tagging::VERSION | ||
|
||
s.authors = ["Leon Berenschot"] | ||
s.email = ["LeonB@beriedata.nl"] | ||
|
||
s.summary = "Tag your deployed commit to git" | ||
s.description = <<-EOF | ||
With every commit tag the local and remote branch with a tag | ||
EOF | ||
|
||
s.date = "2011-01-31" | ||
s.homepage = "http://github.com/dimko/capistrano-tagging" | ||
|
||
s.add_dependency "capistrano", ">= 1.0.0" | ||
|
||
s.files = `git ls-files`.split("\n") | ||
s.has_rdoc = false | ||
|
||
s.require_path = 'lib' | ||
end |
This file was deleted.
Oops, something went wrong.
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,51 @@ | ||
unless Capistrano::Configuration.respond_to?(:instance) | ||
abort "capistrano/tagging requires Capistrano 2" | ||
end | ||
|
||
require 'capistrano' | ||
|
||
Capistrano::Configuration.instance.load do | ||
|
||
after "deploy:restart", "tagging:deploy" | ||
before "deploy:cleanup", "tagging:cleanup" | ||
|
||
namespace :tags do | ||
|
||
def tag(options = {}) | ||
tag_format = (tag_format || ':rails_env_:release').gsub(/(:[a-z_]+)[^:]/i) do |match| | ||
method = $1.to_sym | ||
match = options[method] || send(method) || '' | ||
end | ||
|
||
tag_format | ||
end | ||
|
||
desc "Place release tag into Git and push it to server." | ||
task :deploy do | ||
user = `git config --get user.name` | ||
email = `git config --get user.email` | ||
|
||
puts `git tag #{tag(:release => release_name)} #{revision} -m "Deployed by #{user} <#{email}>"` | ||
puts `git push --tags` | ||
end | ||
|
||
desc "Remove deleted release tag from Git and push it to server." | ||
task :cleanup do | ||
count = fetch(:keep_releases, 5).to_i | ||
if count >= releases.length | ||
logger.important "no old release tags to clean up" | ||
else | ||
logger.info "keeping #{count} of #{releases.length} release tags" | ||
|
||
tags = (releases - releases.last(count)).map { |release| tag(:release => release) } | ||
|
||
tags.each do |tag| | ||
`git tag -d #{tag}` | ||
`git push origin :refs/tags/#{tag}` | ||
end | ||
end | ||
end | ||
|
||
end | ||
|
||
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,5 @@ | ||
module Capistrano | ||
class Tagging | ||
VERSION = "0.0.3" | ||
end | ||
end |