Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

init update

  • Loading branch information...
commit 5938ecd697da4bd47d61b452273101f44f0cc37e 1 parent ff6551b
@dimko authored
View
4 CHANGELOG.rdoc
@@ -1,3 +1,7 @@
+== 0.0.3 (October 31, 2011)
+
+* Added stage to tag name
+
== 0.0.1 (May 6, 2010)
* Inital Check-in
View
3  Gemfile
@@ -0,0 +1,3 @@
+source :gemcutter
+
+gemspec
View
29 Gemfile.lock
@@ -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!
View
5 Manifest
@@ -1,5 +0,0 @@
-CHANGELOG.rdoc
-lib/capistrano/git/tags.rb
-MIT-LICENSE
-README.markdown
-Manifest
View
24 README.markdown
@@ -1,24 +0,0 @@
-Capistrano GitTagging Extension
-====
-
-Automagically tag your current deployed release with capistrano
-
-Install:
-
- gem install capistrano-git-tags
-
-usage: put this in the top in your deploy.rb:
-
- require 'capistrano/git/tags'
-
-TODO
----
-
-* specify the formatting of the tag
-
-Original idea:
----
-
-* [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)
View
27 README.md
@@ -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)
View
24 capistrano-git-tags.gemspec
@@ -1,24 +0,0 @@
-
-
-Gem::Specification.new do |s|
- s.platform = Gem::Platform::RUBY
- s.name = "capistrano-git-tags"
- s.version = "0.0.2"
- 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.files = ["CHANGELOG.rdoc", "lib/capistrano/git/tags.rb", "MIT-LICENSE", "README.markdown", "Manifest"]
-
- s.authors = ["Leon Berenschot"]
- s.email = ["LeonB@beriedata.nl"]
- s.date = "2010-05-06"
- s.homepage = "http://github.com/leipeleon/capistrano-git-tags"
-
- s.add_dependency("capistrano", [">= 1.0.0"])
-
- s.has_rdoc = false
-end
-
-# WARNING: no rubyforge_project specified
View
26 capistrano-tagging.gemspec
@@ -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
View
53 lib/capistrano/git/tags.rb
@@ -1,53 +0,0 @@
-unless Capistrano::Configuration.respond_to?(:instance)
- abort "capistrano/git/tags requires Capistrano 2"
-end
-
-require 'capistrano'
-
-Capistrano::Configuration.instance.load do
-
- after "deploy:restart", "git:tags:push_deploy_tag"
- before "deploy:cleanup", "git:tags:cleanup_deploy_tag"
-
- namespace :git do
-
- namespace :tags do
-
- def tag_format(options = {})
- tag_format = git_tag_format || ":stage_:release"
- tag_format = tag_format.gsub(":stage", options[:stage] || stage)
- tag_format = tag_format.gsub(":release", options[:release] || "")
- tag_format
- end
-
- desc "Place release tag into Git and push it to server."
- task :push_deploy_tag do
- user = `git config --get user.name`
- email = `git config --get user.email`
-
- puts `git tag #{tag_format(: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_deploy_tag 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_format(:release => release) }
-
- tags.each do |tag|
- `git tag -d #{tag}`
- `git push origin :refs/tags/#{tag}`
- end
- end
- end
-
- end
-
- end
-
-end
View
51 lib/capistrano/tagging.rb
@@ -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
View
5 lib/capistrano/tagging/version.rb
@@ -0,0 +1,5 @@
+module Capistrano
+ class Tagging
+ VERSION = "0.0.3"
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.