capistrano-tagging 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -0
- data/CHANGELOG.rdoc +7 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +29 -0
- data/MIT-LICENSE +20 -0
- data/README.md +27 -0
- data/Rakefile +2 -0
- data/capistrano-tagging.gemspec +26 -0
- data/lib/capistrano/tagging/version.rb +5 -0
- data/lib/capistrano/tagging.rb +51 -0
- metadata +70 -0
data/.gitignore
ADDED
data/CHANGELOG.rdoc
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
capistrano-tagging (0.0.3)
|
5
|
+
capistrano (>= 1.0.0)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: http://rubygems.org/
|
9
|
+
specs:
|
10
|
+
capistrano (2.9.0)
|
11
|
+
highline
|
12
|
+
net-scp (>= 1.0.0)
|
13
|
+
net-sftp (>= 2.0.0)
|
14
|
+
net-ssh (>= 2.0.14)
|
15
|
+
net-ssh-gateway (>= 1.1.0)
|
16
|
+
highline (1.6.2)
|
17
|
+
net-scp (1.0.4)
|
18
|
+
net-ssh (>= 1.99.1)
|
19
|
+
net-sftp (2.0.5)
|
20
|
+
net-ssh (>= 2.0.9)
|
21
|
+
net-ssh (2.2.1)
|
22
|
+
net-ssh-gateway (1.1.0)
|
23
|
+
net-ssh (>= 1.99.1)
|
24
|
+
|
25
|
+
PLATFORMS
|
26
|
+
ruby
|
27
|
+
|
28
|
+
DEPENDENCIES
|
29
|
+
capistrano-tagging!
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2006 Jamis Buck, 2010 Leon Berenschot
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
Capistrano tagging
|
2
|
+
====
|
3
|
+
|
4
|
+
Automagically tag your current deployed release with capistrano
|
5
|
+
|
6
|
+
Install
|
7
|
+
----
|
8
|
+
|
9
|
+
gem install capistrano-tagging
|
10
|
+
|
11
|
+
Usage
|
12
|
+
----
|
13
|
+
|
14
|
+
in deploy.rb:
|
15
|
+
|
16
|
+
require 'capistrano/tagging'
|
17
|
+
|
18
|
+
set :tag_format, ':rails_env_:release' # by default, also available all of deploy variables
|
19
|
+
|
20
|
+
Original idea:
|
21
|
+
---
|
22
|
+
|
23
|
+
* [https://github.com/LeipeLeon/capistrano-git-tags](https://github.com/LeipeLeon/capistrano-git-tags)
|
24
|
+
|
25
|
+
* [http://wendbaar.nl/blog/2010/04/automagically-tagging-releases-in-github/](http://wendbaar.nl/blog/2010/04/automagically-tagging-releases-in-github/)
|
26
|
+
|
27
|
+
* [http://gist.github.com/381852](http://gist.github.com/381852)
|
data/Rakefile
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require File.expand_path("../lib/capistrano/tagging/version", __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |s|
|
5
|
+
s.name = "capistrano-tagging"
|
6
|
+
s.platform = Gem::Platform::RUBY
|
7
|
+
s.version = Capistrano::Tagging::VERSION
|
8
|
+
|
9
|
+
s.authors = ["Dimko", "Leon Berenschot"]
|
10
|
+
s.email = ["deemox@gmail.com", "LeonB@beriedata.nl"]
|
11
|
+
|
12
|
+
s.summary = "Tag your deployed commit to git"
|
13
|
+
s.description = <<-EOF
|
14
|
+
With every commit tag the local and remote branch with a tag
|
15
|
+
EOF
|
16
|
+
|
17
|
+
s.date = "2011-01-31"
|
18
|
+
s.homepage = "http://github.com/dimko/capistrano-tagging"
|
19
|
+
|
20
|
+
s.add_dependency "capistrano", ">= 1.0.0"
|
21
|
+
|
22
|
+
s.files = `git ls-files`.split("\n")
|
23
|
+
s.has_rdoc = false
|
24
|
+
|
25
|
+
s.require_path = 'lib'
|
26
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
unless Capistrano::Configuration.respond_to?(:instance)
|
2
|
+
abort "capistrano/tagging requires Capistrano 2"
|
3
|
+
end
|
4
|
+
|
5
|
+
require 'capistrano'
|
6
|
+
|
7
|
+
Capistrano::Configuration.instance.load do
|
8
|
+
|
9
|
+
after "deploy:restart", "tagging:deploy"
|
10
|
+
before "deploy:cleanup", "tagging:cleanup"
|
11
|
+
|
12
|
+
namespace :tags do
|
13
|
+
|
14
|
+
def tag(options = {})
|
15
|
+
tag_format = (tag_format || ':rails_env_:release').gsub(/(:[a-z_]+)[^:]/i) do |match|
|
16
|
+
method = $1.to_sym
|
17
|
+
match = options[method] || send(method) || ''
|
18
|
+
end
|
19
|
+
|
20
|
+
tag_format
|
21
|
+
end
|
22
|
+
|
23
|
+
desc "Place release tag into Git and push it to server."
|
24
|
+
task :deploy do
|
25
|
+
user = `git config --get user.name`
|
26
|
+
email = `git config --get user.email`
|
27
|
+
|
28
|
+
puts `git tag #{tag(:release => release_name)} #{revision} -m "Deployed by #{user} <#{email}>"`
|
29
|
+
puts `git push --tags`
|
30
|
+
end
|
31
|
+
|
32
|
+
desc "Remove deleted release tag from Git and push it to server."
|
33
|
+
task :cleanup do
|
34
|
+
count = fetch(:keep_releases, 5).to_i
|
35
|
+
if count >= releases.length
|
36
|
+
logger.important "no old release tags to clean up"
|
37
|
+
else
|
38
|
+
logger.info "keeping #{count} of #{releases.length} release tags"
|
39
|
+
|
40
|
+
tags = (releases - releases.last(count)).map { |release| tag(:release => release) }
|
41
|
+
|
42
|
+
tags.each do |tag|
|
43
|
+
`git tag -d #{tag}`
|
44
|
+
`git push origin :refs/tags/#{tag}`
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
metadata
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: capistrano-tagging
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.4
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Dimko
|
9
|
+
- Leon Berenschot
|
10
|
+
autorequire:
|
11
|
+
bindir: bin
|
12
|
+
cert_chain: []
|
13
|
+
date: 2011-01-31 00:00:00.000000000Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: capistrano
|
17
|
+
requirement: &70288226748760 !ruby/object:Gem::Requirement
|
18
|
+
none: false
|
19
|
+
requirements:
|
20
|
+
- - ! '>='
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 1.0.0
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: *70288226748760
|
26
|
+
description: ! ' With every commit tag the local and remote branch with a tag
|
27
|
+
|
28
|
+
'
|
29
|
+
email:
|
30
|
+
- deemox@gmail.com
|
31
|
+
- LeonB@beriedata.nl
|
32
|
+
executables: []
|
33
|
+
extensions: []
|
34
|
+
extra_rdoc_files: []
|
35
|
+
files:
|
36
|
+
- .gitignore
|
37
|
+
- CHANGELOG.rdoc
|
38
|
+
- Gemfile
|
39
|
+
- Gemfile.lock
|
40
|
+
- MIT-LICENSE
|
41
|
+
- README.md
|
42
|
+
- Rakefile
|
43
|
+
- capistrano-tagging.gemspec
|
44
|
+
- lib/capistrano/tagging.rb
|
45
|
+
- lib/capistrano/tagging/version.rb
|
46
|
+
homepage: http://github.com/dimko/capistrano-tagging
|
47
|
+
licenses: []
|
48
|
+
post_install_message:
|
49
|
+
rdoc_options: []
|
50
|
+
require_paths:
|
51
|
+
- lib
|
52
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
53
|
+
none: false
|
54
|
+
requirements:
|
55
|
+
- - ! '>='
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '0'
|
58
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
59
|
+
none: false
|
60
|
+
requirements:
|
61
|
+
- - ! '>='
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: '0'
|
64
|
+
requirements: []
|
65
|
+
rubyforge_project:
|
66
|
+
rubygems_version: 1.8.10
|
67
|
+
signing_key:
|
68
|
+
specification_version: 3
|
69
|
+
summary: Tag your deployed commit to git
|
70
|
+
test_files: []
|