Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Initial Commit, Version 0.0.1

  • Loading branch information...
commit 349901dadbd6145a261456af5401809a21924803 0 parents
@LeipeLeon authored
3  CHANGELOG.rdoc
@@ -0,0 +1,3 @@
+== 0.0.1 (May 6, 2010)
+
+* Inital Check-in
20 MIT-LICENSE
@@ -0,0 +1,20 @@
+Copyright (c) 2006 Jamis Buck, 2010 Leon Berenschot
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
5 Manifest
@@ -0,0 +1,5 @@
+CHANGELOG.rdoc
+lib/capistrano/git-tags.rb
+MIT-LICENSE
+README.markdown
+Manifest
19 README.markdown
@@ -0,0 +1,19 @@
+Capistrano GitTagging Extension
+====
+
+
+Automagically tag your current deployed release with capistrano
+
+usage:
+
+put this in the top in your deploy.rb:
+
+ require 'capistrano/git-tags'
+
+
+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)
24 capistrano-git-tags.gemspec
@@ -0,0 +1,24 @@
+
+
+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
46 lib/capistrano/git/tags.rb
@@ -0,0 +1,46 @@
+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
+
+ 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 #{rails_env}_#{release_name} #{revision} -m "Deployed by #{user} <#{email}>"`
+ puts `git push --tags`
+ end
+
+ desc "Place release tag into 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| "#{rails_env}_#{release}" }
+
+ tags.each do |tag|
+ `git tag -d #{tag}`
+ `git push origin :refs/tags/#{tag}`
+ end
+ end
+ end
+
+ end
+
+ end
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.