capistrano-git-tags 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,3 @@
1
+ == 0.0.1 (May 6, 2010)
2
+
3
+ * Inital Check-in
@@ -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.
@@ -0,0 +1,5 @@
1
+ CHANGELOG.rdoc
2
+ lib/capistrano/git/tags.rb
3
+ MIT-LICENSE
4
+ README.markdown
5
+ Manifest
@@ -0,0 +1,19 @@
1
+ Capistrano GitTagging Extension
2
+ ====
3
+
4
+
5
+ Automagically tag your current deployed release with capistrano
6
+
7
+ usage:
8
+
9
+ put this in the top in your deploy.rb:
10
+
11
+ require 'capistrano/git-tags'
12
+
13
+
14
+ Original idea:
15
+ ---
16
+
17
+ * [http://wendbaar.nl/blog/2010/04/automagically-tagging-releases-in-github/](http://wendbaar.nl/blog/2010/04/automagically-tagging-releases-in-github/)
18
+
19
+ * [http://gist.github.com/381852](http://gist.github.com/381852)
@@ -0,0 +1,46 @@
1
+ unless Capistrano::Configuration.respond_to?(:instance)
2
+ abort "capistrano/git/tags requires Capistrano 2"
3
+ end
4
+
5
+ require 'capistrano'
6
+
7
+ Capistrano::Configuration.instance.load do
8
+
9
+ after "deploy:restart", "git:tags:push_deploy_tag"
10
+ before "deploy:cleanup", "git:tags:cleanup_deploy_tag"
11
+
12
+ namespace :git do
13
+
14
+ namespace :tags do
15
+
16
+ desc "Place release tag into Git and push it to server."
17
+ task :push_deploy_tag do
18
+ user = `git config --get user.name`
19
+ email = `git config --get user.email`
20
+
21
+ puts `git tag #{rails_env}_#{release_name} #{revision} -m "Deployed by #{user} <#{email}>"`
22
+ puts `git push --tags`
23
+ end
24
+
25
+ desc "Place release tag into Git and push it to server."
26
+ task :cleanup_deploy_tag do
27
+ count = fetch(:keep_releases, 5).to_i
28
+ if count >= releases.length
29
+ logger.important "no old release tags to clean up"
30
+ else
31
+ logger.info "keeping #{count} of #{releases.length} release tags"
32
+
33
+ tags = (releases - releases.last(count)).map { |release| "#{rails_env}_#{release}" }
34
+
35
+ tags.each do |tag|
36
+ `git tag -d #{tag}`
37
+ `git push origin :refs/tags/#{tag}`
38
+ end
39
+ end
40
+ end
41
+
42
+ end
43
+
44
+ end
45
+
46
+ end
metadata ADDED
@@ -0,0 +1,80 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: capistrano-git-tags
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 0
8
+ - 2
9
+ version: 0.0.2
10
+ platform: ruby
11
+ authors:
12
+ - Leon Berenschot
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2010-05-06 00:00:00 +02:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: capistrano
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ segments:
28
+ - 1
29
+ - 0
30
+ - 0
31
+ version: 1.0.0
32
+ type: :runtime
33
+ version_requirements: *id001
34
+ description: " With every commit tag the local and remote branch with a tag\n"
35
+ email:
36
+ - LeonB@beriedata.nl
37
+ executables: []
38
+
39
+ extensions: []
40
+
41
+ extra_rdoc_files: []
42
+
43
+ files:
44
+ - CHANGELOG.rdoc
45
+ - lib/capistrano/git/tags.rb
46
+ - MIT-LICENSE
47
+ - README.markdown
48
+ - Manifest
49
+ has_rdoc: true
50
+ homepage: http://github.com/leipeleon/capistrano-git-tags
51
+ licenses: []
52
+
53
+ post_install_message:
54
+ rdoc_options: []
55
+
56
+ require_paths:
57
+ - lib
58
+ required_ruby_version: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ segments:
63
+ - 0
64
+ version: "0"
65
+ required_rubygems_version: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ segments:
70
+ - 0
71
+ version: "0"
72
+ requirements: []
73
+
74
+ rubyforge_project:
75
+ rubygems_version: 1.3.6
76
+ signing_key:
77
+ specification_version: 3
78
+ summary: Tag your deployed commit to git
79
+ test_files: []
80
+