cap-deploy-tagger 0.0.2 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -11,8 +11,8 @@ Capistrano 2.x, use [capistrano-deploy-tagger](https://github.com/forward/capist
11
11
 
12
12
  ## Why would you tag on deploy?
13
13
 
14
- One reason you would want to tag on deploy is to keep track of what commit is currently
15
- in production (or in staging or some other stage). You may also want to track this
14
+ One reason you would want to tag on deploy is to keep track of what commit is currently
15
+ in production (or in staging or some other stage). You may also want to track this
16
16
  if you're using some kind of scaling process to deploy code - this will allow you to
17
17
  deploy the same release that other servers are currently using.
18
18
 
@@ -31,7 +31,7 @@ so that it's not deployed to your production servers:
31
31
 
32
32
  Now add the gem to your Capistrano `Capfile`:
33
33
 
34
- require 'cap-deploy-tagger'
34
+ require 'cap-deploy-tagger/capistrano'
35
35
 
36
36
  ## Usage and configuration
37
37
 
@@ -55,7 +55,7 @@ You may want to skip tagging in some instances - to do so, either set the Capist
55
55
 
56
56
  # From the command line
57
57
  SKIP_DEPLOY_TAGGING=true cap production deploy
58
-
58
+
59
59
  # Inside your deploy.rb
60
60
  set :skip_deploy_tagging, true
61
61
 
@@ -0,0 +1,8 @@
1
+ # Ensure deploy tasks are loaded before we run
2
+ require 'capistrano/deploy'
3
+
4
+ # Load extra tasks into the deploy namespace
5
+ load File.expand_path("../tasks/tagger.rake", __FILE__)
6
+
7
+ module CapDeployTagger
8
+ end
@@ -2,14 +2,19 @@ namespace :deploy do
2
2
 
3
3
  desc "Tag deployed release"
4
4
  task :tag do
5
- if ENV['SKIP_DEPLOY_TAGGING'] || fetch(:skip_deploy_tagging, false)
6
- puts "[cap-deploy-tagger] Skipped deploy tagging"
7
- else
8
- tag = CapDeployTagger::Helper.tag(fetch(:deploy_tag, "deployed"), fetch(:stage))
9
- puts "[cap-deploy-tagger] Tagged #{CapDeployTagger::Helper.latest_revision} with #{tag}"
5
+ run_locally do
6
+ if ENV['SKIP_DEPLOY_TAGGING'] || fetch(:skip_deploy_tagging, false)
7
+ info "[cap-deploy-tagger] Skipped deploy tagging"
8
+ else
9
+ tag_name = "#{fetch(:deploy_tag, "deployed")}_#{fetch(:stage)}"
10
+ latest_revision = fetch(:current_revision)
11
+ strategy.git "tag -f #{tag_name} #{latest_revision}"
12
+ strategy.git "push -f --tags"
13
+ info "[cap-deploy-tagger] Tagged #{latest_revision} with #{tag_name}"
14
+ end
10
15
  end
11
16
  end
12
17
 
13
18
  after :cleanup, 'deploy:tag'
14
19
 
15
- end
20
+ end
@@ -1,3 +1,3 @@
1
1
  module CapDeployTagger
2
- VERSION = "0.0.2"
3
- end
2
+ VERSION = "0.1.0"
3
+ end
@@ -1,25 +0,0 @@
1
- # Ensure deploy tasks are loaded before we run
2
- require 'capistrano/deploy'
3
-
4
- # Load extra tasks into the deploy namespace
5
- load File.expand_path("../cap-deploy-tagger/tasks/tagger.rake", __FILE__)
6
-
7
- module CapDeployTagger
8
- class Helper
9
-
10
- def self.tag(tag, stage)
11
- git "tag -f #{tag}_#{stage}"
12
- git "push -f --tags"
13
- "#{tag}_#{stage}"
14
- end
15
-
16
- def self.git(cmd)
17
- `git #{cmd} 2>&1`.chomp
18
- end
19
-
20
- def self.latest_revision
21
- git "rev-parse --short HEAD"
22
- end
23
-
24
- end
25
- end
metadata CHANGED
@@ -1,18 +1,20 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cap-deploy-tagger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.1.0
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Andy Sykes
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2013-12-09 00:00:00.000000000 Z
12
+ date: 2014-07-07 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: bundler
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
19
  - - ~>
18
20
  - !ruby/object:Gem::Version
@@ -20,6 +22,7 @@ dependencies:
20
22
  type: :development
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
23
26
  requirements:
24
27
  - - ~>
25
28
  - !ruby/object:Gem::Version
@@ -27,15 +30,17 @@ dependencies:
27
30
  - !ruby/object:Gem::Dependency
28
31
  name: rake
29
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
30
34
  requirements:
31
- - - '>='
35
+ - - ! '>='
32
36
  - !ruby/object:Gem::Version
33
37
  version: '0'
34
38
  type: :development
35
39
  prerelease: false
36
40
  version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
37
42
  requirements:
38
- - - '>='
43
+ - - ! '>='
39
44
  - !ruby/object:Gem::Version
40
45
  version: '0'
41
46
  description: Automatically tag Git commits when deploying with Capistrano
@@ -52,30 +57,38 @@ files:
52
57
  - Rakefile
53
58
  - cap-deploy-tagger.gemspec
54
59
  - lib/cap-deploy-tagger.rb
60
+ - lib/cap-deploy-tagger/capistrano.rb
55
61
  - lib/cap-deploy-tagger/tasks/tagger.rake
56
62
  - lib/cap-deploy-tagger/version.rb
57
63
  homepage: https://github.com/forward3d/cap-deploy-tagger
58
64
  licenses:
59
65
  - MIT
60
- metadata: {}
61
66
  post_install_message:
62
67
  rdoc_options: []
63
68
  require_paths:
64
69
  - lib
65
70
  required_ruby_version: !ruby/object:Gem::Requirement
71
+ none: false
66
72
  requirements:
67
- - - '>='
73
+ - - ! '>='
68
74
  - !ruby/object:Gem::Version
69
75
  version: '0'
76
+ segments:
77
+ - 0
78
+ hash: 22969979815138706
70
79
  required_rubygems_version: !ruby/object:Gem::Requirement
80
+ none: false
71
81
  requirements:
72
- - - '>='
82
+ - - ! '>='
73
83
  - !ruby/object:Gem::Version
74
84
  version: '0'
85
+ segments:
86
+ - 0
87
+ hash: 22969979815138706
75
88
  requirements: []
76
89
  rubyforge_project:
77
- rubygems_version: 2.1.10
90
+ rubygems_version: 1.8.23
78
91
  signing_key:
79
- specification_version: 4
92
+ specification_version: 3
80
93
  summary: Automatically tag Git commits when deploying with Capistrano
81
94
  test_files: []
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 76d71f88b15abe3df2c9e23e3bc78c39fb1a2718
4
- data.tar.gz: 793ae0087d381a4b8bc7fb98af22095222b13105
5
- SHA512:
6
- metadata.gz: 453491102514dfd2c963e6377d88bebd609b5520cc3993e41082851eae93be0427038bdf58498cfad2f5b412ef9224de7aba642c017d9cbaf680cb83e980f9c7
7
- data.tar.gz: 505fc694c160963ca23f90a6a5f3ddfda4e61099616ba7cb01b11f1541d6e0d759f1513c0994469c5ad158ed1b34524450c2b1b6d6a9894d08b99a442b9ad8f5