capistrano-fanfare 0.0.18 → 0.0.19

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.md CHANGED
@@ -1,8 +1,12 @@
1
- # Capistrano::Fanfare [![Build Status](https://secure.travis-ci.org/fnichol/capistrano-fanfare.png)](http://travis-ci.org/fnichol/capistrano-fanfare) [![Dependency Status](https://gemnasium.com/fnichol/capistrano-fanfare.png)](https://gemnasium.com/fnichol/capistrano-fanfare)
1
+ # <a name="title"></a> Capistrano::Fanfare [![Build Status](https://secure.travis-ci.org/fnichol/capistrano-fanfare.png)](http://travis-ci.org/fnichol/capistrano-fanfare) [![Dependency Status](https://gemnasium.com/fnichol/capistrano-fanfare.png)](https://gemnasium.com/fnichol/capistrano-fanfare)
2
2
 
3
- TODO: Write a gem description
3
+ **Notice:** This README is under active development.
4
4
 
5
- ## Installation
5
+ ## <a name="features"></a> Features
6
+
7
+ Coming soon...
8
+
9
+ ## <a name="installation"></a> Installation
6
10
 
7
11
  Add this line to your application's Gemfile:
8
12
 
@@ -12,13 +16,7 @@ And then execute:
12
16
 
13
17
  $ bundle
14
18
 
15
- Or install it yourself as:
16
-
17
- $ gem install capistrano-fanfare
18
-
19
- ## Usage
20
-
21
- TODO: Write usage instructions here
19
+ ## <a name="usage"></a> Usage
22
20
 
23
21
  Create a `Capfile` that looks like:
24
22
 
@@ -43,7 +41,7 @@ Create a `Capfile` that looks like:
43
41
  fanfare_recipe 'campfire'
44
42
  fanfare_recipe 'airbrake'
45
43
 
46
- Dir['vendor/gems/*/recipes/*.rb','vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
44
+ Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
47
45
 
48
46
  load 'config/deploy'
49
47
 
@@ -79,10 +77,164 @@ There are several optional recipes that need additional gems in your Gemfile:
79
77
  gem 'capistrano-campfire'
80
78
  end
81
79
 
82
- ## Contributing
80
+ ## <a name="recipes"></a> Recipes
81
+
82
+ **Foundational**
83
+
84
+ * [git_style](#recipes-git-style):
85
+ GitHub-style deployments, fully compatible with third party recipes.
86
+ * [foreman](#recipes-foreman):
87
+ Forget Unicorns, Resque workers, and God. Think processes.
88
+ * [bundler](#recipes-bundler):
89
+ Binstub `PATH`-aware deployments with custom shebangs and more.
90
+
91
+ **Core**
92
+
93
+ * [defaults](#recipes-defatuls):
94
+ Common baseline defaults and an augmented `deploy:cold`.
95
+ * [multistage](#recipes-multistage):
96
+ Deploy to multiple environments like `"staging"` and `"production"`.
97
+ * [assets](#recipes-assets):
98
+ Rails asset pipeline support: done!
99
+ * [database_yaml](#recipes-database-yaml):
100
+ No more database password baked in your code, leave that up to the server.
101
+ * [db_seed](#recipes-db-seed):
102
+ Seeding your Rails database, autowired into `deploy:cold`.
103
+
104
+ **Gravy**
105
+
106
+ * [ssh](#recipes-ssh):
107
+ Connect to your infrastructure nodes without thinking.
108
+ * [console](#recipes-console):
109
+ Rails 2/3, Sinatra, and Rack consoles, running in one command.
110
+ * [colors](#recipes-colors):
111
+ Deploys, but prettier.
112
+ * [campfire](#recipes-campfire):
113
+ Notify your team of deployment and maintenace events.
114
+ * [airbrake](#recipes-airbrake):
115
+ Track your deployments in Airbrake/Hoptoad/Errbit
116
+ * [info](#recipes-info):
117
+ Deployment configuration information, available at a glance.
118
+
119
+ ### <a name="recipes-foundational"></a> Foundational
120
+
121
+ #### <a name="recipes-git-style"></a> git_style
122
+
123
+ > GitHub-style deployments, fully compatible with third party recipes.
124
+
125
+ A Git style deployment strategy based on GitHub's
126
+ [Deployment Script Spring Cleaning][github_spring] blog post.
127
+
128
+ #### <a name="recipes-foreman"></a> foreman
129
+
130
+ > Forget Unicorns, Resque workers, and God. Think processes.
131
+
132
+ #### <a name="recipes-bundler"></a> bundler
133
+
134
+ > Binstub `PATH`-aware deployments with custom shebangs and more.
135
+
136
+ Uses the delivered [Bundler][cap_bundler] implementation with support for
137
+ shebangs, binstubs `PATH` inclusion, and a generated `bin/bundle` binstub
138
+ script file.
139
+
140
+ ### <a name="recipes-core"></a> Core
141
+
142
+ #### <a name="recipes-defaults"></a> defaults
143
+
144
+ > Common baseline defaults and an augmented `deploy:cold`.
145
+
146
+ #### <a name="recipes-multistage"></a> multistage
147
+
148
+ > Deploy to multiple environments like `"staging"` and `"production"`.
83
149
 
84
- 1. Fork it
150
+ Uses the delivered [Capistrano multistage][cap_multistage] implementation with
151
+ a few additional helpers.
152
+
153
+ #### <a name="recipes-asssets"></a> assets
154
+
155
+ > Rails asset pipeline support: done!
156
+
157
+ #### <a name="recipes-db-seed"></a> db_seed
158
+
159
+ > Tracking deployments in Airbrake
160
+
161
+ #### <a name="recipes-database-yaml"></a> database_yaml
162
+
163
+ > No more database password baked in your code, leave that up to the server.
164
+
165
+ ### <a name="recipes-gravy"></a> Gravy
166
+
167
+ #### <a name="recipes-ssh"></a> ssh
168
+
169
+ > Connect to your infrastructure nodes without thinking.
170
+
171
+ #### <a name="recipes-console"></a> console
172
+
173
+ > Rails 2/3, Sinatra, and Rack consoles, running in one command.
174
+
175
+ #### <a name="recipes-colors"></a> colors
176
+
177
+ > Deploys, but prettier.
178
+
179
+ > Rails console, ready for input in one command.
180
+
181
+ #### <a name="recipes-campfire"></a> campfire
182
+
183
+ > Notify your team of deployment and maintenace events.
184
+
185
+ #### <a name="recipes-airbrake"></a> airbrake
186
+
187
+ > Track your deployments in Airbrake/Hoptoad/Errbit
188
+
189
+ #### <a name="recipes-info"></a> info
190
+
191
+ > Deployment configuration, available at a glance.
192
+
193
+ ## <a name="development"></a> Development
194
+
195
+ * Source hosted at [GitHub][repo]
196
+ * Report issues/questions/feature requests on [GitHub Issues][issues]
197
+
198
+ Pull requests are very welcome! Make sure your patches are well tested.
199
+ Ideally create a topic branch for every separate change you make. For
200
+ example:
201
+
202
+ 1. Fork the repo
85
203
  2. Create your feature branch (`git checkout -b my-new-feature`)
86
204
  3. Commit your changes (`git commit -am 'Added some feature'`)
87
205
  4. Push to the branch (`git push origin my-new-feature`)
88
206
  5. Create new Pull Request
207
+
208
+ ## <a name="authors"></a> Authors
209
+
210
+ Created and maintained by [Fletcher Nichol][fnichol] (<fnichol@nichol.ca>)
211
+
212
+ ## <a name="license"></a> License
213
+
214
+ MIT (see [LICENSE][license])
215
+
216
+ [defaults_src]: https://github.com/fnichol/capistrano-fanfare/blob/master/lib/capistrano/fanfare/defaults.rb
217
+ [multistage_src]: https://github.com/fnichol/capistrano-fanfare/blob/master/lib/capistrano/fanfare/multistage.rb
218
+ [git_style_src]: https://github.com/fnichol/capistrano-fanfare/blob/master/lib/capistrano/fanfare/git_style.rb
219
+ [bundler_src]: https://github.com/fnichol/capistrano-fanfare/blob/master/lib/capistrano/fanfare/bundler.rb
220
+ [assets_src]: https://github.com/fnichol/capistrano-fanfare/blob/master/lib/capistrano/fanfare/assets.rb
221
+ [db_seed_src]: https://github.com/fnichol/capistrano-fanfare/blob/master/lib/capistrano/fanfare/db_seed.rb
222
+ [foreman_src]: https://github.com/fnichol/capistrano-fanfare/blob/master/lib/capistrano/fanfare/foreman.rb
223
+ [database_yaml_src]: https://github.com/fnichol/capistrano-fanfare/blob/master/lib/capistrano/fanfare/database_yaml.rb
224
+ [info_src]: https://github.com/fnichol/capistrano-fanfare/blob/master/lib/capistrano/fanfare/info.rb
225
+ [colors_src]: https://github.com/fnichol/capistrano-fanfare/blob/master/lib/capistrano/fanfare/colors.rb
226
+ [ssh_src]: https://github.com/fnichol/capistrano-fanfare/blob/master/lib/capistrano/fanfare/ssh.rb
227
+ [console_src]: https://github.com/fnichol/capistrano-fanfare/blob/master/lib/capistrano/fanfare/console.rb
228
+ [campfire_src]: https://github.com/fnichol/capistrano-fanfare/blob/master/lib/capistrano/fanfare/campfire.rb
229
+ [airbrake_src]: https://github.com/fnichol/capistrano-fanfare/blob/master/lib/capistrano/fanfare/airbrake.rb
230
+
231
+ [cap_assets]: https://github.com/capistrano/capistrano/blob/master/lib/capistrano/recipes/deploy/assets.rb
232
+ [cap_bundler]: https://github.com/carlhuda/bundler/blob/master/lib/bundler/capistrano.rb
233
+ [cap_multistage]: https://github.com/capistrano/capistrano/blob/master/lib/capistrano/ext/multistage.rb
234
+ [github_spring]: https://github.com/blog/470-deployment-script-spring-cleaning
235
+ [license]: https://github.com/fnichol/capistrano-fanfare/blob/master/LICENSE
236
+
237
+ [fnichol]: https://github.com/fnichol
238
+ [repo]: https://github.com/fnichol/capistrano-fanfare
239
+ [issues]: https://github.com/fnichol/capistrano-fanfare/issues
240
+ [contributors]: https://github.com/fnichol/capistrano-fanfare/contributors
@@ -45,8 +45,6 @@ module Capistrano::Fanfare::Bundler
45
45
 
46
46
  require 'bundler/capistrano'
47
47
 
48
- set(:rake) { "rake" }
49
-
50
48
  # =========================================================================
51
49
  # These are the tasks that are available to help with deploying web apps.
52
50
  # You can have cap give you a summary of them with `cap -T'.
@@ -9,13 +9,21 @@ module Capistrano::Fanfare::Defaults
9
9
  set(:branch) { ENV['BRANCH'] ? ENV['BRANCH'] : "master" }
10
10
  set(:deploy_to) { "/srv/#{application}_#{deploy_env}" }
11
11
  set :ssh_options, { :forward_agent => true }
12
- set :os_types, [:darwin, :linux, :sunos]
12
+ set :os_types, [:darwin, :linux, :sunos, :mswin]
13
13
  set(:os_type) { capture("uname -s").chomp.downcase.to_sym }
14
14
 
15
15
  set :shared_children, %w{public/system log tmp/pids tmp/sockets tmp/sessions}
16
16
 
17
17
  default_run_options[:pty] = true
18
18
 
19
+ on :load do
20
+ if exists?(:foreman_cmd) # foreman recipe has been loaded
21
+ set :rake, "#{fetch(:foreman_cmd)} run rake"
22
+ elsif exists?(:bundle_shebang) # bundler recipe has been loaded
23
+ set :rake, "rake"
24
+ end
25
+ end
26
+
19
27
  ##
20
28
  # Determines deployment environment or run mode to help database naming,
21
29
  # deploy directories, etc.
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module Fanfare
3
- VERSION = "0.0.18"
3
+ VERSION = "0.0.19"
4
4
  end
5
5
  end
data/spec/bundler_spec.rb CHANGED
@@ -52,10 +52,6 @@ load Gem.bin_path('bundler', 'bundle')
52
52
  BINSTUB
53
53
  end
54
54
 
55
- it "sets :rake to 'rake'" do
56
- @config.fetch(:rake).must_equal "rake"
57
- end
58
-
59
55
  describe ":bundle_flags" do
60
56
  after do
61
57
  ENV.delete('QUIET')
@@ -2,6 +2,8 @@ require 'minitest/autorun'
2
2
  require 'minitest/capistrano'
3
3
  require 'capistrano/fanfare'
4
4
  require 'capistrano/fanfare/defaults'
5
+ require 'capistrano/fanfare/bundler'
6
+ require 'capistrano/fanfare/foreman'
5
7
 
6
8
  describe Capistrano::Fanfare::Defaults do
7
9
  before do
@@ -111,7 +113,7 @@ describe Capistrano::Fanfare::Defaults do
111
113
  end
112
114
 
113
115
  it "sets :os_types to a list of OSes" do
114
- @config.fetch(:os_types).must_equal [:darwin, :linux, :sunos]
116
+ @config.fetch(:os_types).must_equal [:darwin, :linux, :sunos, :mswin]
115
117
  end
116
118
 
117
119
  describe ":os_type" do
@@ -139,6 +141,30 @@ describe Capistrano::Fanfare::Defaults do
139
141
  must_equal %w{public/system log tmp/pids tmp/sockets tmp/sessions}
140
142
  end
141
143
 
144
+ it "sets :rake to 'rake' if bundler recipe is loaded" do
145
+ Capistrano::Fanfare::Bundler.load_into(@config)
146
+ @config.trigger(:load)
147
+
148
+ @config.fetch(:rake).must_equal "rake"
149
+ end
150
+
151
+ it "sets :rake to 'foreman run rake' if foreman recipe is loaded" do
152
+ Capistrano::Fanfare::Foreman.load_into(@config)
153
+ @config.set :foreman_cmd, "da/foreman"
154
+ @config.trigger(:load)
155
+
156
+ @config.fetch(:rake).must_equal "da/foreman run rake"
157
+ end
158
+
159
+ it "sets :rake to 'foreman run rake' if foreman and bundler recipes are loaded" do
160
+ Capistrano::Fanfare::Foreman.load_into(@config)
161
+ Capistrano::Fanfare::Bundler.load_into(@config)
162
+ @config.set :foreman_cmd, "fman"
163
+ @config.trigger(:load)
164
+
165
+ @config.fetch(:rake).must_equal "fman run rake"
166
+ end
167
+
142
168
  describe "for :deploy namespace" do
143
169
  describe "task :cold" do
144
170
  before do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-fanfare
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.18
4
+ version: 0.0.19
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-02-25 00:00:00.000000000 Z
12
+ date: 2012-03-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: capistrano
16
- requirement: &2165100220 !ruby/object:Gem::Requirement
16
+ requirement: &70314802799240 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 2.11.1
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2165100220
24
+ version_requirements: *70314802799240
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: capistrano_colors
27
- requirement: &2165099620 !ruby/object:Gem::Requirement
27
+ requirement: &70314802798680 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0.5'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2165099620
35
+ version_requirements: *70314802798680
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: sushi
38
- requirement: &2165098740 !ruby/object:Gem::Requirement
38
+ requirement: &70314802798100 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 0.0.2
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *2165098740
46
+ version_requirements: *70314802798100
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: minitest
49
- requirement: &2165098240 !ruby/object:Gem::Requirement
49
+ requirement: &70314802797500 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 2.11.2
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *2165098240
57
+ version_requirements: *70314802797500
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: minitest-capistrano
60
- requirement: &2165097720 !ruby/object:Gem::Requirement
60
+ requirement: &70314802797000 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0.0'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *2165097720
68
+ version_requirements: *70314802797000
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: timecop
71
- requirement: &2165097100 !ruby/object:Gem::Requirement
71
+ requirement: &70314802796240 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ~>
@@ -76,7 +76,7 @@ dependencies:
76
76
  version: '0.3'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *2165097100
79
+ version_requirements: *70314802796240
80
80
  description: Capistrano recipes (with full test suite) for fanfare application deployment
81
81
  framework
82
82
  email:
@@ -146,7 +146,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
146
146
  version: '0'
147
147
  segments:
148
148
  - 0
149
- hash: -2698498875532362211
149
+ hash: 3042953069069299639
150
150
  required_rubygems_version: !ruby/object:Gem::Requirement
151
151
  none: false
152
152
  requirements:
@@ -155,10 +155,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
155
155
  version: '0'
156
156
  segments:
157
157
  - 0
158
- hash: -2698498875532362211
158
+ hash: 3042953069069299639
159
159
  requirements: []
160
160
  rubyforge_project:
161
- rubygems_version: 1.8.17
161
+ rubygems_version: 1.8.15
162
162
  signing_key:
163
163
  specification_version: 3
164
164
  summary: Capistrano recipes (with full test suite) for fanfare application deployment