capistrano-gitflow 1.4.0 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +3 -1
- data/VERSION +1 -1
- data/capistrano-gitflow.gemspec +15 -16
- data/lib/capistrano/gitflow.rb +20 -12
- metadata +17 -6
data/README.rdoc
CHANGED
@@ -10,7 +10,9 @@ Gitflow simply adds some tagging/logging/workflow magic.
|
|
10
10
|
# AFTER
|
11
11
|
$ cap deploy
|
12
12
|
# 'master' goes to staging; tag staging-YYYY-MM-DD.X created
|
13
|
-
$ cap production deploy
|
13
|
+
$ cap production deploy
|
14
|
+
# deploys latest staging tag, or if last tag is a production tag then that, to production
|
15
|
+
# for specifying the tag by hand add `-s tag=staging-YYYY-MM-DD-X-user-description`
|
14
16
|
# tag 'staging-YYYY-MM-DD-X' goes to production
|
15
17
|
# tag 'production-YYYY-MM-DD-X' created; points to staging-YYYY-MM-DD-X
|
16
18
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.4.
|
1
|
+
1.4.1
|
data/capistrano-gitflow.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{capistrano-gitflow}
|
8
|
-
s.version = "1.4.
|
8
|
+
s.version = "1.4.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Joshua Nichols"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-10-26}
|
13
13
|
s.description = %q{Capistrano recipe for a deployment workflow based on git tags}
|
14
14
|
s.email = %q{josh@technicalpickles.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -17,32 +17,31 @@ Gem::Specification.new do |s|
|
|
17
17
|
]
|
18
18
|
s.files = [
|
19
19
|
".document",
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
20
|
+
"README.rdoc",
|
21
|
+
"Rakefile",
|
22
|
+
"VERSION",
|
23
|
+
"capistrano-gitflow.gemspec",
|
24
|
+
"lib/capistrano/gitflow.rb",
|
25
|
+
"lib/capistrano/gitflow/natcmp.rb",
|
26
|
+
"recipes/gitflow_recipes.rb",
|
27
|
+
"spec/gitflow_spec.rb",
|
28
|
+
"spec/spec.opts",
|
29
|
+
"spec/spec_helper.rb"
|
30
30
|
]
|
31
31
|
s.homepage = %q{http://github.com/technicalpickles/capistrano-gitflow}
|
32
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
33
32
|
s.require_paths = ["lib"]
|
34
|
-
s.rubygems_version = %q{1.3.
|
33
|
+
s.rubygems_version = %q{1.3.7}
|
35
34
|
s.summary = %q{Capistrano recipe for a deployment workflow based on git tags}
|
36
35
|
s.test_files = [
|
37
36
|
"spec/gitflow_spec.rb",
|
38
|
-
|
37
|
+
"spec/spec_helper.rb"
|
39
38
|
]
|
40
39
|
|
41
40
|
if s.respond_to? :specification_version then
|
42
41
|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
43
42
|
s.specification_version = 3
|
44
43
|
|
45
|
-
if Gem::Version.new(Gem::
|
44
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
46
45
|
s.add_runtime_dependency(%q<capistrano>, [">= 0"])
|
47
46
|
s.add_runtime_dependency(%q<stringex>, [">= 0"])
|
48
47
|
s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
|
data/lib/capistrano/gitflow.rb
CHANGED
@@ -46,12 +46,17 @@ module Capistrano
|
|
46
46
|
last_tag_matching('production-*')
|
47
47
|
end
|
48
48
|
|
49
|
+
def using_git?
|
50
|
+
fetch(:scm, :git).to_sym == :git
|
51
|
+
end
|
52
|
+
|
49
53
|
task :verify_up_to_date do
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
54
|
+
if using_git?
|
55
|
+
set :local_branch, `git branch --no-color 2> /dev/null | sed -e '/^[^*]/d'`.gsub(/\* /, '').chomp
|
56
|
+
set :local_sha, `git log --pretty=format:%H HEAD -1`.chomp
|
57
|
+
set :origin_sha, `git log --pretty=format:%H #{local_branch} -1`
|
58
|
+
unless local_sha == origin_sha
|
59
|
+
abort """
|
55
60
|
Your #{local_branch} branch is not up to date with origin/#{local_branch}.
|
56
61
|
Please make sure you have pulled and pushed all code before deploying:
|
57
62
|
|
@@ -60,19 +65,22 @@ Please make sure you have pulled and pushed all code before deploying:
|
|
60
65
|
git push origin #{local_branch}
|
61
66
|
|
62
67
|
"""
|
68
|
+
end
|
63
69
|
end
|
64
70
|
end
|
65
71
|
|
66
72
|
desc "Calculate the tag to deploy"
|
67
73
|
task :calculate_tag do
|
68
|
-
|
69
|
-
|
74
|
+
if using_git?
|
75
|
+
# make sure we have any other deployment tags that have been pushed by others so our auto-increment code doesn't create conflicting tags
|
76
|
+
`git fetch`
|
70
77
|
|
71
|
-
|
78
|
+
send "tag_#{stage}"
|
72
79
|
|
73
|
-
|
74
|
-
|
75
|
-
|
80
|
+
system "git push --tags origin #{local_branch}"
|
81
|
+
if $? != 0
|
82
|
+
abort "git push failed"
|
83
|
+
end
|
76
84
|
end
|
77
85
|
end
|
78
86
|
|
@@ -121,11 +129,11 @@ Please make sure you have pulled and pushed all code before deploying:
|
|
121
129
|
`git log --pretty=format:%H #{last_staging_tag} -1`
|
122
130
|
end
|
123
131
|
|
124
|
-
new_staging_tag = next_staging_tag
|
125
132
|
if last_staging_tag_sha == current_sha
|
126
133
|
puts "Not re-tagging staging because the most recent tag (#{last_staging_tag}) already points to current head"
|
127
134
|
new_staging_tag = last_staging_tag
|
128
135
|
else
|
136
|
+
new_staging_tag = next_staging_tag
|
129
137
|
puts "Tagging current branch for deployment to staging as '#{new_staging_tag}'"
|
130
138
|
system "git tag -a -m 'tagging current code for deployment to staging' #{new_staging_tag}"
|
131
139
|
end
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-gitflow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 5
|
4
5
|
prerelease: false
|
5
6
|
segments:
|
6
7
|
- 1
|
7
8
|
- 4
|
8
|
-
-
|
9
|
-
version: 1.4.
|
9
|
+
- 1
|
10
|
+
version: 1.4.1
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Joshua Nichols
|
@@ -14,16 +15,18 @@ autorequire:
|
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
17
|
|
17
|
-
date: 2010-
|
18
|
+
date: 2010-10-26 00:00:00 -04:00
|
18
19
|
default_executable:
|
19
20
|
dependencies:
|
20
21
|
- !ruby/object:Gem::Dependency
|
21
22
|
name: capistrano
|
22
23
|
prerelease: false
|
23
24
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
24
26
|
requirements:
|
25
27
|
- - ">="
|
26
28
|
- !ruby/object:Gem::Version
|
29
|
+
hash: 3
|
27
30
|
segments:
|
28
31
|
- 0
|
29
32
|
version: "0"
|
@@ -33,9 +36,11 @@ dependencies:
|
|
33
36
|
name: stringex
|
34
37
|
prerelease: false
|
35
38
|
requirement: &id002 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
36
40
|
requirements:
|
37
41
|
- - ">="
|
38
42
|
- !ruby/object:Gem::Version
|
43
|
+
hash: 3
|
39
44
|
segments:
|
40
45
|
- 0
|
41
46
|
version: "0"
|
@@ -45,9 +50,11 @@ dependencies:
|
|
45
50
|
name: rspec
|
46
51
|
prerelease: false
|
47
52
|
requirement: &id003 !ruby/object:Gem::Requirement
|
53
|
+
none: false
|
48
54
|
requirements:
|
49
55
|
- - ">="
|
50
56
|
- !ruby/object:Gem::Version
|
57
|
+
hash: 13
|
51
58
|
segments:
|
52
59
|
- 1
|
53
60
|
- 2
|
@@ -80,28 +87,32 @@ homepage: http://github.com/technicalpickles/capistrano-gitflow
|
|
80
87
|
licenses: []
|
81
88
|
|
82
89
|
post_install_message:
|
83
|
-
rdoc_options:
|
84
|
-
|
90
|
+
rdoc_options: []
|
91
|
+
|
85
92
|
require_paths:
|
86
93
|
- lib
|
87
94
|
required_ruby_version: !ruby/object:Gem::Requirement
|
95
|
+
none: false
|
88
96
|
requirements:
|
89
97
|
- - ">="
|
90
98
|
- !ruby/object:Gem::Version
|
99
|
+
hash: 3
|
91
100
|
segments:
|
92
101
|
- 0
|
93
102
|
version: "0"
|
94
103
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
104
|
+
none: false
|
95
105
|
requirements:
|
96
106
|
- - ">="
|
97
107
|
- !ruby/object:Gem::Version
|
108
|
+
hash: 3
|
98
109
|
segments:
|
99
110
|
- 0
|
100
111
|
version: "0"
|
101
112
|
requirements: []
|
102
113
|
|
103
114
|
rubyforge_project:
|
104
|
-
rubygems_version: 1.3.
|
115
|
+
rubygems_version: 1.3.7
|
105
116
|
signing_key:
|
106
117
|
specification_version: 3
|
107
118
|
summary: Capistrano recipe for a deployment workflow based on git tags
|