capistrano-tampon 3.0.2 → 3.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/capistrano-tampon.gemspec +2 -2
- data/lib/capistrano/tampon/utilities.rb +10 -8
- data/lib/capistrano/tasks/hooks.cap +1 -1
- data/lib/capistrano/tasks/tampon.cap +5 -5
- metadata +2 -3
- data/README.rdoc +0 -74
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b18d5ae0a26082a101bc319ac05552d4fe5658c1
|
4
|
+
data.tar.gz: 82dcf2957825ab49eafb840d0b181f8201c4622b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b9ea3510ffd9f5a1dfdd0fda127cde9846a27bfc373322713f4c6ccc64fd1c6aa7582a56a7b4cf991f80ec083a64ce95947cad269b62edd81597164b9d45484
|
7
|
+
data.tar.gz: 4625a304551db0c300053ba855b769e7eff2d879b0b686fadce8fc8c6dc0bb2f85968224b631e60029a186163e58e3b3577f526b1abf08f95febb6d64eb84b43
|
data/capistrano-tampon.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "capistrano-tampon"
|
5
|
-
s.version = "3.0.
|
5
|
+
s.version = "3.0.3"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new("> 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Spencer Markowski"]
|
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
|
|
11
11
|
s.email = "spencer@theablefew.com"
|
12
12
|
s.extra_rdoc_files = [
|
13
13
|
"LICENSE.txt",
|
14
|
-
"README.
|
14
|
+
"README.md"
|
15
15
|
]
|
16
16
|
s.files = [
|
17
17
|
"Gemfile",
|
@@ -43,11 +43,13 @@ module Capistrano
|
|
43
43
|
def available_tags
|
44
44
|
puts "Available Tags:".color :green
|
45
45
|
puts "#{releases.sort.reverse.take(Capistrano::Tampon::Configuration.previous_releases.to_i).join("\n")}"
|
46
|
+
puts "\n"
|
46
47
|
end
|
47
48
|
|
48
49
|
def available_releases
|
49
50
|
puts "\nAvailable Releases:".color :green
|
50
51
|
puts "#{releases.reverse.take(Capistrano::Tampon::Configuration.previous_releases.to_i).join("\n")}"
|
52
|
+
puts "\n"
|
51
53
|
end
|
52
54
|
|
53
55
|
def banner
|
@@ -66,22 +68,22 @@ module Capistrano
|
|
66
68
|
|
67
69
|
def deploy_from
|
68
70
|
puts banner unless Capistrano::Tampon::Configuration.prude.to_i == 1
|
69
|
-
if stage == :production
|
71
|
+
if fetch(:stage) == :production
|
70
72
|
available_releases
|
71
|
-
from_destination
|
73
|
+
set :from_destination, ask("\nRelease to deploy:".color(:yellow).bright, lastest_release)
|
72
74
|
else
|
73
|
-
create_tag
|
74
|
-
return next_tag if create_tag
|
75
|
+
set :create_tag, ask("\nDo you want to tag deployment?".color(:yellow).bright, 'N')
|
76
|
+
return next_tag if fetch(:create_tag).downcase =~ /^[Yy]$/
|
75
77
|
available_tags
|
76
|
-
from_destination
|
78
|
+
set :from_destination, ask("\nBranch, tag or release to deploy:".color(:yellow).bright, current_branch)
|
77
79
|
end
|
78
|
-
return from_destination
|
80
|
+
return fetch(:from_destination)
|
79
81
|
end
|
80
82
|
|
81
83
|
def next_tag
|
82
84
|
hwhen = Date.today.to_s
|
83
|
-
what
|
84
|
-
new_staging_tag = "#{hwhen}-#{who}-#{what}"
|
85
|
+
set :what, ask("\nWhat does this release introduce?".color(:yellow).bright, nil)
|
86
|
+
new_staging_tag = "#{hwhen}-#{who}-#{fetch(:what)}"
|
85
87
|
puts "Tagging current branch for deployment to staging as '#{new_staging_tag}'".color(:green)
|
86
88
|
system "git tag -a -m 'tagging current code for deployment to staging' #{new_staging_tag}"
|
87
89
|
return new_staging_tag
|
@@ -1,2 +1,2 @@
|
|
1
|
-
before 'deploy:
|
1
|
+
before 'deploy:starting', 'tampon:calculate_tag'
|
2
2
|
before 'tampon:calculate_tag', 'tampon:verify_up_to_date'
|
@@ -48,7 +48,7 @@ namespace :tampon do
|
|
48
48
|
end
|
49
49
|
|
50
50
|
task :tag_staging do
|
51
|
-
staging_destination =
|
51
|
+
staging_destination = deploy_from
|
52
52
|
|
53
53
|
set :branch, staging_destination
|
54
54
|
end
|
@@ -62,13 +62,13 @@ namespace :tampon do
|
|
62
62
|
desc "Push the approved tag to production. Pass in tag to deploy with '-s tag=staging-YYYY-MM-DD-X-feature'."
|
63
63
|
task :tag_production do
|
64
64
|
|
65
|
-
|
65
|
+
production_destination = deploy_from
|
66
66
|
|
67
|
-
really_deploy
|
67
|
+
set :really_deploy, ask("Do you really want to deploy #{production_destination}?", "N")
|
68
68
|
|
69
|
-
exit(1) unless really_deploy =~ /^[Yy]$/
|
69
|
+
exit(1) unless fetch(:really_deploy) =~ /^[Yy]$/
|
70
70
|
|
71
|
-
|
71
|
+
set :branch, production_destination
|
72
72
|
end
|
73
73
|
end
|
74
74
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-tampon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Spencer Markowski
|
@@ -100,12 +100,11 @@ executables: []
|
|
100
100
|
extensions: []
|
101
101
|
extra_rdoc_files:
|
102
102
|
- LICENSE.txt
|
103
|
-
- README.
|
103
|
+
- README.md
|
104
104
|
files:
|
105
105
|
- Gemfile
|
106
106
|
- LICENSE.txt
|
107
107
|
- README.md
|
108
|
-
- README.rdoc
|
109
108
|
- VERSION
|
110
109
|
- able.rc
|
111
110
|
- capistrano-tampon.gemspec
|
data/README.rdoc
DELETED
@@ -1,74 +0,0 @@
|
|
1
|
-
= tampon
|
2
|
-
|
3
|
-
,-------------.
|
4
|
-
(o) _ __ _____ )--.
|
5
|
-
`-------------' )
|
6
|
-
( /
|
7
|
-
`---'
|
8
|
-
|
9
|
-
Tampon provides Gitflow integration with Capistrano, without unessecary restrictions to the deploy process. Our goal with tampon was to improve on capistrano-gitflow by allowing you to tag a staging release (or not tag a staging release),
|
10
|
-
deploy from the HEAD of whatever branch you are on (feature, develop, hotfix, etc), and deploy to production from bonafide gitflow release tags.
|
11
|
-
|
12
|
-
== Installation
|
13
|
-
|
14
|
-
You can use the most recent tampon gem by adding it to your Gemfile:
|
15
|
-
|
16
|
-
gem 'tampon'
|
17
|
-
|
18
|
-
Or install it the old-fashioned way:
|
19
|
-
|
20
|
-
gem install tampon
|
21
|
-
|
22
|
-
|
23
|
-
== Capistrano Setup
|
24
|
-
|
25
|
-
Add this to `Capfile`, after `require
|
26
|
-
|
27
|
-
require 'capistrano/ext/multistage'
|
28
|
-
require 'capistrano/tampon'
|
29
|
-
|
30
|
-
That's all you need. Tampon will set the :branch variable and allow you deploy from any tag, branch or release whenever you wish.
|
31
|
-
|
32
|
-
== Optional Setup
|
33
|
-
|
34
|
-
If you're using the gitflow binary https://github.com/nvie/gitflow , tampon provides a nice helper to initialize your project using our favorite defaults:
|
35
|
-
|
36
|
-
rake gitflow:prepare
|
37
|
-
|
38
|
-
This will attempt to create a develop branch if one doesn't exist locally or remotely, track it and add the following defaults:
|
39
|
-
|
40
|
-
gitflow.branch.master = master
|
41
|
-
gitflow.branch.develop = develop
|
42
|
-
gtiflow.prefix.versiontag = v
|
43
|
-
|
44
|
-
=== Deploy to staging
|
45
|
-
|
46
|
-
To deploy what you're currently working on to staging:
|
47
|
-
|
48
|
-
cap staging deploy
|
49
|
-
|
50
|
-
Tampon will ask if you'd like to tag the release. The tag will include the date, who is deploying and a message. You will then be able to specify that tag as what you'd like to deploy.
|
51
|
-
|
52
|
-
=== Deploy to production
|
53
|
-
|
54
|
-
After you've finished a release branch, tampon will show you all the available releases to deploy from:
|
55
|
-
|
56
|
-
cap production deploy
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
== Contributing to tampon
|
61
|
-
|
62
|
-
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
63
|
-
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
|
64
|
-
* Fork the project
|
65
|
-
* Start a feature/bugfix branch
|
66
|
-
* Commit and push until you are happy with your contribution
|
67
|
-
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
68
|
-
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
69
|
-
|
70
|
-
== Copyright
|
71
|
-
|
72
|
-
Copyright (c) 2011 Spencer Markowski (The Able Few, LLC). See LICENSE.txt for
|
73
|
-
further details.
|
74
|
-
|