capistrano 2.5.7 → 2.5.8
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.rdoc +4 -5
- data/README.rdoc +0 -54
- data/lib/capistrano/recipes/deploy.rb +155 -11
- data/lib/capistrano/version.rb +1 -1
- metadata +2 -6
- data/capistrano.gemspec +0 -51
- data/lib/capistrano/recipes/ext/rails-database-migrations.rb +0 -50
- data/lib/capistrano/recipes/ext/rails-shared-directories.rb +0 -21
- data/lib/capistrano/recipes/ext/web-disable-enable.rb +0 -40
data/CHANGELOG.rdoc
CHANGED
@@ -1,15 +1,14 @@
|
|
1
|
-
== 2.5.
|
1
|
+
== 2.5.8 / July 2009
|
2
2
|
|
3
|
-
*
|
3
|
+
* Fixes a problem in 2.5.7 where deploy:finalize_update had been badly merged.
|
4
4
|
|
5
|
-
== 2.5.6 /
|
5
|
+
== 2.5.6 & 2.5.7 / July 2009
|
6
6
|
|
7
|
+
* 2.5.7 masks a broken 2.5.6 release that was accidentally mirrored via Rubyforge.
|
7
8
|
* Clean the cached git repository [Graeme Mathieson]
|
8
9
|
* Fixes perforce issues reported at http://bit.ly/wt0es [Scott Johnson]
|
9
10
|
* Improved back-tick handling code in relation to the above.
|
10
|
-
* Removes rails-assumptions, more info see a freshly generated config/deploy.rb
|
11
11
|
* Fixes a Git issue when submodules update upstream. (via mailing list) [sneakin]
|
12
|
-
* Ensures that the deploy_to directory is chowned :user/:user during deploy:setup
|
13
12
|
* Capify now creates the config directory in directories without one.
|
14
13
|
|
15
14
|
== 2.5.5 / 24 Feb 2009
|
data/README.rdoc
CHANGED
@@ -5,21 +5,6 @@ Capistrano is a utility and framework for executing commands in parallel on mult
|
|
5
5
|
Capistrano was originally designed to simplify and automate deployment of web applications to distributed environments, and originally came bundled with a set of tasks designed for deploying Rails applications. The deployment tasks are now (as of Capistrano 2.0) opt-in and require clients to explicitly put
|
6
6
|
"load 'deploy'" in their recipes.
|
7
7
|
|
8
|
-
== 2.5.6 Warning
|
9
|
-
|
10
|
-
_+Warning+_: while every care has been taken to make sure you do not feel too much disruption from existing deploys when upgrading to 2.5.6 unless you alter your capfile (see "New Style Capification" towards the end of the readme for more) will require a couple more lines to keep compatibility with old recipes.
|
11
|
-
|
12
|
-
The changes in 2.5.6 include bug fixes, but importantly also remove a number of rails assumptions. This has been done both to ensure that people who aren't deploy Rails applications aren't put-off using Capistrano, and also that those of us that do use Rails have a choice about certain things. (starting our app, restarting it, stopping it, do we want cap to manage migrations, etc..)
|
13
|
-
|
14
|
-
As a result failure to read this document thoroughly could lead to problems, if you do install 2.5.6 and your recipe breaks, please either uninstall the gem and file a bug report (we will try to fix them within hours if received through our lighthouse app account.) or invoke cap in the following way to dictate which version you wish to use:
|
15
|
-
|
16
|
-
cap _2.5.5_ deploy
|
17
|
-
cap _2.5.5_ staging my:task:here
|
18
|
-
cap _2.5.5_ -vT
|
19
|
-
cap _2.5.6_ -vT
|
20
|
-
|
21
|
-
Please open issues on the bug tracer at http://capistrano.lighthouseapp.com/ if you experience problems
|
22
|
-
|
23
8
|
== Documentation
|
24
9
|
|
25
10
|
We know that documentation is something that really lets us down, that's why there is a repository for a handbook below, please open an issue on it if you would like something documented:
|
@@ -91,45 +76,6 @@ If you have multiple versions of capistrano (or indeed any gem with a binary) in
|
|
91
76
|
cap _2.5.5_ deploy
|
92
77
|
cap _2.5.6_ deploy:setup
|
93
78
|
|
94
|
-
== New Style Capification
|
95
|
-
|
96
|
-
When calling `capify` on a new application, the result will look something like the following, this is a big change to previous versions, please take this as a warning and read the following thoroughly:
|
97
|
-
|
98
|
-
set :application, "set your application name here"
|
99
|
-
set :repository, "set your repository location here"
|
100
|
-
|
101
|
-
# If you have previously been relying upon the code to start, stop
|
102
|
-
# and restart your mongrel application, or if you rely on the database
|
103
|
-
# migration code, please uncomment the lines you require below
|
104
|
-
|
105
|
-
# If you are deploying a rails app you probably need these:
|
106
|
-
|
107
|
-
# load 'ext/rails-database-migrations.rb'
|
108
|
-
# load 'ext/rails-shared-directories.rb'
|
109
|
-
|
110
|
-
# There are also new utility libaries shipped with the core these
|
111
|
-
# include the following, please see individual files for more
|
112
|
-
# documentation, or run `cap -vT` with the following lines commented
|
113
|
-
# out to see what they make available.
|
114
|
-
|
115
|
-
# load 'ext/spinner.rb' # Designed for use with script/spin
|
116
|
-
# load 'ext/passenger-mod-rails.rb' # Restart task for use with mod_rails
|
117
|
-
# load 'ext/web-disable-enable.rb' # Gives you web:disable and web:enable
|
118
|
-
|
119
|
-
# If you aren't deploying to /u/apps/\#{application} on the target
|
120
|
-
# servers (which is the default), you can specify the actual location
|
121
|
-
# via the :deploy_to variable:
|
122
|
-
# set :deploy_to, "/var/www/\#{application}"
|
123
|
-
|
124
|
-
# If you aren't using Subversion to manage your source code, specify
|
125
|
-
# your SCM below:
|
126
|
-
# set :scm, :subversion
|
127
|
-
# see a full list by running "gem contents capistrano | grep 'scm/'"
|
128
|
-
|
129
|
-
role :web, "your web-server here"
|
130
|
-
|
131
|
-
When adding or removing extensions, where you have previously tested a `deploy:setup` we recommend that you perform another, especially for example when adding the rails-shared-directory code.
|
132
|
-
|
133
79
|
== LICENSE:
|
134
80
|
|
135
81
|
(The MIT License)
|
@@ -151,18 +151,9 @@ namespace :deploy do
|
|
151
151
|
DESC
|
152
152
|
task :default do
|
153
153
|
update
|
154
|
-
|
154
|
+
restart
|
155
155
|
end
|
156
156
|
|
157
|
-
[:start, :stop, :restart].each do |deprecated_task|
|
158
|
-
desc "#{deprecated_task.to_s} is deprecated. Please see "
|
159
|
-
task deprecated_task do
|
160
|
-
|
161
|
-
end
|
162
|
-
end
|
163
|
-
|
164
|
-
|
165
|
-
|
166
157
|
desc <<-DESC
|
167
158
|
Prepares one or more servers for deployment. Before you can use any \
|
168
159
|
of the Capistrano deployment tasks with your project, you will need to \
|
@@ -231,6 +222,23 @@ namespace :deploy do
|
|
231
222
|
DESC
|
232
223
|
task :finalize_update, :except => { :no_release => true } do
|
233
224
|
run "chmod -R g+w #{latest_release}" if fetch(:group_writable, true)
|
225
|
+
|
226
|
+
# mkdir -p is making sure that the directories are there for some SCM's that don't
|
227
|
+
# save empty folders
|
228
|
+
run <<-CMD
|
229
|
+
rm -rf #{latest_release}/log #{latest_release}/public/system #{latest_release}/tmp/pids &&
|
230
|
+
mkdir -p #{latest_release}/public &&
|
231
|
+
mkdir -p #{latest_release}/tmp &&
|
232
|
+
ln -s #{shared_path}/log #{latest_release}/log &&
|
233
|
+
ln -s #{shared_path}/system #{latest_release}/public/system &&
|
234
|
+
ln -s #{shared_path}/pids #{latest_release}/tmp/pids
|
235
|
+
CMD
|
236
|
+
|
237
|
+
if fetch(:normalize_asset_timestamps, true)
|
238
|
+
stamp = Time.now.utc.strftime("%Y%m%d%H%M.%S")
|
239
|
+
asset_paths = %w(images stylesheets javascripts).map { |p| "#{latest_release}/public/#{p}" }.join(" ")
|
240
|
+
run "find #{asset_paths} -exec touch -t #{stamp} {} ';'; true", :env => { "TZ" => "UTC" }
|
241
|
+
end
|
234
242
|
end
|
235
243
|
|
236
244
|
desc <<-DESC
|
@@ -279,6 +287,21 @@ namespace :deploy do
|
|
279
287
|
files.each { |file| top.upload(file, File.join(current_path, file)) }
|
280
288
|
end
|
281
289
|
|
290
|
+
desc <<-DESC
|
291
|
+
Restarts your application. This works by calling the script/process/reaper \
|
292
|
+
script under the current path.
|
293
|
+
|
294
|
+
By default, this will be invoked via sudo as the `app' user. If \
|
295
|
+
you wish to run it as a different user, set the :runner variable to \
|
296
|
+
that user. If you are in an environment where you can't use sudo, set \
|
297
|
+
the :use_sudo variable to false:
|
298
|
+
|
299
|
+
set :use_sudo, false
|
300
|
+
DESC
|
301
|
+
task :restart, :roles => :app, :except => { :no_release => true } do
|
302
|
+
try_runner "#{current_path}/script/process/reaper"
|
303
|
+
end
|
304
|
+
|
282
305
|
namespace :rollback do
|
283
306
|
desc <<-DESC
|
284
307
|
[internal] Points the current symlink at the previous revision.
|
@@ -305,7 +328,8 @@ namespace :deploy do
|
|
305
328
|
desc <<-DESC
|
306
329
|
Rolls back to the previously deployed version. The `current' symlink will \
|
307
330
|
be updated to point at the previously deployed version, and then the \
|
308
|
-
current release will be removed from the servers.
|
331
|
+
current release will be removed from the servers. You'll generally want \
|
332
|
+
to call `rollback' instead, as it performs a `restart' as well.
|
309
333
|
DESC
|
310
334
|
task :code, :except => { :no_release => true } do
|
311
335
|
revision
|
@@ -319,10 +343,56 @@ namespace :deploy do
|
|
319
343
|
DESC
|
320
344
|
task :default do
|
321
345
|
revision
|
346
|
+
restart
|
322
347
|
cleanup
|
323
348
|
end
|
324
349
|
end
|
325
350
|
|
351
|
+
desc <<-DESC
|
352
|
+
Run the migrate rake task. By default, it runs this in most recently \
|
353
|
+
deployed version of the app. However, you can specify a different release \
|
354
|
+
via the migrate_target variable, which must be one of :latest (for the \
|
355
|
+
default behavior), or :current (for the release indicated by the \
|
356
|
+
`current' symlink). Strings will work for those values instead of symbols, \
|
357
|
+
too. You can also specify additional environment variables to pass to rake \
|
358
|
+
via the migrate_env variable. Finally, you can specify the full path to the \
|
359
|
+
rake executable by setting the rake variable. The defaults are:
|
360
|
+
|
361
|
+
set :rake, "rake"
|
362
|
+
set :rails_env, "production"
|
363
|
+
set :migrate_env, ""
|
364
|
+
set :migrate_target, :latest
|
365
|
+
DESC
|
366
|
+
task :migrate, :roles => :db, :only => { :primary => true } do
|
367
|
+
rake = fetch(:rake, "rake")
|
368
|
+
rails_env = fetch(:rails_env, "production")
|
369
|
+
migrate_env = fetch(:migrate_env, "")
|
370
|
+
migrate_target = fetch(:migrate_target, :latest)
|
371
|
+
|
372
|
+
directory = case migrate_target.to_sym
|
373
|
+
when :current then current_path
|
374
|
+
when :latest then current_release
|
375
|
+
else raise ArgumentError, "unknown migration target #{migrate_target.inspect}"
|
376
|
+
end
|
377
|
+
|
378
|
+
run "cd #{directory}; #{rake} RAILS_ENV=#{rails_env} #{migrate_env} db:migrate"
|
379
|
+
end
|
380
|
+
|
381
|
+
desc <<-DESC
|
382
|
+
Deploy and run pending migrations. This will work similarly to the \
|
383
|
+
`deploy' task, but will also run any pending migrations (via the \
|
384
|
+
`deploy:migrate' task) prior to updating the symlink. Note that the \
|
385
|
+
update in this case it is not atomic, and transactions are not used, \
|
386
|
+
because migrations are not guaranteed to be reversible.
|
387
|
+
DESC
|
388
|
+
task :migrations do
|
389
|
+
set :migrate_target, :latest
|
390
|
+
update_code
|
391
|
+
migrate
|
392
|
+
symlink
|
393
|
+
restart
|
394
|
+
end
|
395
|
+
|
326
396
|
desc <<-DESC
|
327
397
|
Clean up old releases. By default, the last 5 releases are kept on each \
|
328
398
|
server (though you can change this with the keep_releases variable). All \
|
@@ -392,6 +462,40 @@ namespace :deploy do
|
|
392
462
|
DESC
|
393
463
|
task :cold do
|
394
464
|
update
|
465
|
+
migrate
|
466
|
+
start
|
467
|
+
end
|
468
|
+
|
469
|
+
desc <<-DESC
|
470
|
+
Start the application servers. This will attempt to invoke a script \
|
471
|
+
in your application called `script/spin', which must know how to start \
|
472
|
+
your application listeners. For Rails applications, you might just have \
|
473
|
+
that script invoke `script/process/spawner' with the appropriate \
|
474
|
+
arguments.
|
475
|
+
|
476
|
+
By default, the script will be executed via sudo as the `app' user. If \
|
477
|
+
you wish to run it as a different user, set the :runner variable to \
|
478
|
+
that user. If you are in an environment where you can't use sudo, set \
|
479
|
+
the :use_sudo variable to false.
|
480
|
+
DESC
|
481
|
+
task :start, :roles => :app do
|
482
|
+
run "cd #{current_path} && #{try_runner} nohup script/spin"
|
483
|
+
end
|
484
|
+
|
485
|
+
desc <<-DESC
|
486
|
+
Stop the application servers. This will call script/process/reaper for \
|
487
|
+
both the spawner process, and all of the application processes it has \
|
488
|
+
spawned. As such, it is fairly Rails specific and may need to be \
|
489
|
+
overridden for other systems.
|
490
|
+
|
491
|
+
By default, the script will be executed via sudo as the `app' user. If \
|
492
|
+
you wish to run it as a different user, set the :runner variable to \
|
493
|
+
that user. If you are in an environment where you can't use sudo, set \
|
494
|
+
the :use_sudo variable to false.
|
495
|
+
DESC
|
496
|
+
task :stop, :roles => :app do
|
497
|
+
run "if [ -f #{current_path}/tmp/pids/dispatch.spawner.pid ]; then #{try_runner} #{current_path}/script/process/reaper -a kill -r dispatch.spawner.pid; fi"
|
498
|
+
try_runner "#{current_path}/script/process/reaper -a kill"
|
395
499
|
end
|
396
500
|
|
397
501
|
namespace :pending do
|
@@ -415,4 +519,44 @@ namespace :deploy do
|
|
415
519
|
end
|
416
520
|
end
|
417
521
|
|
522
|
+
namespace :web do
|
523
|
+
desc <<-DESC
|
524
|
+
Present a maintenance page to visitors. Disables your application's web \
|
525
|
+
interface by writing a "maintenance.html" file to each web server. The \
|
526
|
+
servers must be configured to detect the presence of this file, and if \
|
527
|
+
it is present, always display it instead of performing the request.
|
528
|
+
|
529
|
+
By default, the maintenance page will just say the site is down for \
|
530
|
+
"maintenance", and will be back "shortly", but you can customize the \
|
531
|
+
page by specifying the REASON and UNTIL environment variables:
|
532
|
+
|
533
|
+
$ cap deploy:web:disable \\
|
534
|
+
REASON="hardware upgrade" \\
|
535
|
+
UNTIL="12pm Central Time"
|
536
|
+
|
537
|
+
Further customization will require that you write your own task.
|
538
|
+
DESC
|
539
|
+
task :disable, :roles => :web, :except => { :no_release => true } do
|
540
|
+
require 'erb'
|
541
|
+
on_rollback { run "rm #{shared_path}/system/maintenance.html" }
|
542
|
+
|
543
|
+
reason = ENV['REASON']
|
544
|
+
deadline = ENV['UNTIL']
|
545
|
+
|
546
|
+
template = File.read(File.join(File.dirname(__FILE__), "templates", "maintenance.rhtml"))
|
547
|
+
result = ERB.new(template).result(binding)
|
548
|
+
|
549
|
+
put result, "#{shared_path}/system/maintenance.html", :mode => 0644
|
550
|
+
end
|
551
|
+
|
552
|
+
desc <<-DESC
|
553
|
+
Makes the application web-accessible again. Removes the \
|
554
|
+
"maintenance.html" page generated by deploy:web:disable, which (if your \
|
555
|
+
web servers are configured correctly) will make your application \
|
556
|
+
web-accessible again.
|
557
|
+
DESC
|
558
|
+
task :enable, :roles => :web, :except => { :no_release => true } do
|
559
|
+
run "rm #{shared_path}/system/maintenance.html"
|
560
|
+
end
|
561
|
+
end
|
418
562
|
end
|
data/lib/capistrano/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.5.
|
4
|
+
version: 2.5.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jamis Buck
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2009-07-
|
13
|
+
date: 2009-07-07 00:00:00 +01:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -195,9 +195,6 @@ files:
|
|
195
195
|
- lib/capistrano/recipes/deploy/strategy.rb
|
196
196
|
- lib/capistrano/recipes/deploy/templates/maintenance.rhtml
|
197
197
|
- lib/capistrano/recipes/deploy.rb
|
198
|
-
- lib/capistrano/recipes/ext/rails-shared-directories.rb
|
199
|
-
- lib/capistrano/recipes/ext/rails-database-migrations.rb
|
200
|
-
- lib/capistrano/recipes/ext/web-disable-enable.rb
|
201
198
|
- lib/capistrano/recipes/standard.rb
|
202
199
|
- lib/capistrano/recipes/templates/maintenance.rhtml
|
203
200
|
- lib/capistrano/recipes/upgrade.rb
|
@@ -250,7 +247,6 @@ files:
|
|
250
247
|
- test/transfer_test.rb
|
251
248
|
- test/utils.rb
|
252
249
|
- Manifest
|
253
|
-
- capistrano.gemspec
|
254
250
|
- test/deploy/scm/none_test.rb
|
255
251
|
has_rdoc: true
|
256
252
|
homepage: http://www.capify.org
|
data/capistrano.gemspec
DELETED
@@ -1,51 +0,0 @@
|
|
1
|
-
Gem::Specification.new do |s|
|
2
|
-
s.name = %q{capistrano}
|
3
|
-
s.version = "2.5.7"
|
4
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
5
|
-
s.authors = ["Jamis Buck", "Lee Hambley"]
|
6
|
-
s.date = %q{2009-07-06}
|
7
|
-
s.description = %q{Capistrano is a utility and framework for executing commands in parallel on multiple remote machines, via SSH.}
|
8
|
-
s.email = %q{lee.hambley@gmail.com}
|
9
|
-
s.executables = ["cap", "capify"]
|
10
|
-
s.extra_rdoc_files = ["CHANGELOG.rdoc", "lib/capistrano/callback.rb", "lib/capistrano/cli/execute.rb", "lib/capistrano/cli/help.rb", "lib/capistrano/cli/help.txt", "lib/capistrano/cli/options.rb", "lib/capistrano/cli/ui.rb", "lib/capistrano/cli.rb", "lib/capistrano/command.rb", "lib/capistrano/configuration/actions/file_transfer.rb", "lib/capistrano/configuration/actions/inspect.rb", "lib/capistrano/configuration/actions/invocation.rb", "lib/capistrano/configuration/callbacks.rb", "lib/capistrano/configuration/connections.rb", "lib/capistrano/configuration/execution.rb", "lib/capistrano/configuration/loading.rb", "lib/capistrano/configuration/namespaces.rb", "lib/capistrano/configuration/roles.rb", "lib/capistrano/configuration/servers.rb", "lib/capistrano/configuration/variables.rb", "lib/capistrano/configuration.rb", "lib/capistrano/errors.rb", "lib/capistrano/extensions.rb", "lib/capistrano/logger.rb", "lib/capistrano/processable.rb", "lib/capistrano/recipes/compat.rb", "lib/capistrano/recipes/deploy/dependencies.rb", "lib/capistrano/recipes/deploy/local_dependency.rb", "lib/capistrano/recipes/deploy/remote_dependency.rb", "lib/capistrano/recipes/deploy/scm/accurev.rb", "lib/capistrano/recipes/deploy/scm/base.rb", "lib/capistrano/recipes/deploy/scm/bzr.rb", "lib/capistrano/recipes/deploy/scm/cvs.rb", "lib/capistrano/recipes/deploy/scm/darcs.rb", "lib/capistrano/recipes/deploy/scm/git.rb", "lib/capistrano/recipes/deploy/scm/mercurial.rb", "lib/capistrano/recipes/deploy/scm/none.rb", "lib/capistrano/recipes/deploy/scm/perforce.rb", "lib/capistrano/recipes/deploy/scm/subversion.rb", "lib/capistrano/recipes/deploy/scm.rb", "lib/capistrano/recipes/deploy/strategy/base.rb", "lib/capistrano/recipes/deploy/strategy/checkout.rb", "lib/capistrano/recipes/deploy/strategy/copy.rb", "lib/capistrano/recipes/deploy/strategy/export.rb", "lib/capistrano/recipes/deploy/strategy/remote.rb", "lib/capistrano/recipes/deploy/strategy/remote_cache.rb", "lib/capistrano/recipes/deploy/strategy.rb", "lib/capistrano/recipes/deploy/templates/maintenance.rhtml", "lib/capistrano/recipes/deploy.rb", "lib/capistrano/recipes/standard.rb", "lib/capistrano/recipes/templates/maintenance.rhtml", "lib/capistrano/recipes/upgrade.rb", "lib/capistrano/role.rb", "lib/capistrano/server_definition.rb", "lib/capistrano/shell.rb", "lib/capistrano/ssh.rb", "lib/capistrano/task_definition.rb", "lib/capistrano/transfer.rb", "lib/capistrano/version.rb", "lib/capistrano.rb", "README.rdoc"]
|
11
|
-
s.files = ["bin/cap", "bin/capify", "CHANGELOG.rdoc", "examples/sample.rb", "lib/capistrano/callback.rb", "lib/capistrano/cli/execute.rb", "lib/capistrano/cli/help.rb", "lib/capistrano/cli/help.txt", "lib/capistrano/cli/options.rb", "lib/capistrano/cli/ui.rb", "lib/capistrano/cli.rb", "lib/capistrano/command.rb", "lib/capistrano/configuration/actions/file_transfer.rb", "lib/capistrano/configuration/actions/inspect.rb", "lib/capistrano/configuration/actions/invocation.rb", "lib/capistrano/configuration/callbacks.rb", "lib/capistrano/configuration/connections.rb", "lib/capistrano/configuration/execution.rb", "lib/capistrano/configuration/loading.rb", "lib/capistrano/configuration/namespaces.rb", "lib/capistrano/configuration/roles.rb", "lib/capistrano/configuration/servers.rb", "lib/capistrano/configuration/variables.rb", "lib/capistrano/configuration.rb", "lib/capistrano/errors.rb",
|
12
|
-
"lib/capistrano/extensions.rb", "lib/capistrano/logger.rb", "lib/capistrano/processable.rb", "lib/capistrano/recipes/compat.rb", "lib/capistrano/recipes/deploy/dependencies.rb", "lib/capistrano/recipes/deploy/local_dependency.rb", "lib/capistrano/recipes/deploy/remote_dependency.rb", "lib/capistrano/recipes/deploy/scm/accurev.rb", "lib/capistrano/recipes/deploy/scm/base.rb", "lib/capistrano/recipes/deploy/scm/bzr.rb", "lib/capistrano/recipes/deploy/scm/cvs.rb", "lib/capistrano/recipes/deploy/scm/darcs.rb", "lib/capistrano/recipes/deploy/scm/git.rb", "lib/capistrano/recipes/deploy/scm/mercurial.rb", "lib/capistrano/recipes/deploy/scm/none.rb", "lib/capistrano/recipes/deploy/scm/perforce.rb", "lib/capistrano/recipes/deploy/scm/subversion.rb", "lib/capistrano/recipes/deploy/scm.rb", "lib/capistrano/recipes/deploy/strategy/base.rb", "lib/capistrano/recipes/deploy/strategy/checkout.rb", "lib/capistrano/recipes/deploy/strategy/copy.rb", "lib/capistrano/recipes/deploy/strategy/export.rb", "lib/capistrano/recipes/deploy/strategy/remote.rb", "lib/capistrano/recipes/deploy/strategy/remote_cache.rb", "lib/capistrano/recipes/deploy/strategy.rb", "lib/capistrano/recipes/deploy/templates/maintenance.rhtml", "lib/capistrano/recipes/deploy.rb",
|
13
|
-
"lib/capistrano/recipes/ext/rails-shared-directories.rb",
|
14
|
-
"lib/capistrano/recipes/ext/rails-database-migrations.rb", "lib/capistrano/recipes/ext/web-disable-enable.rb", "lib/capistrano/recipes/standard.rb", "lib/capistrano/recipes/templates/maintenance.rhtml", "lib/capistrano/recipes/upgrade.rb", "lib/capistrano/role.rb", "lib/capistrano/server_definition.rb", "lib/capistrano/shell.rb", "lib/capistrano/ssh.rb", "lib/capistrano/task_definition.rb", "lib/capistrano/transfer.rb", "lib/capistrano/version.rb", "lib/capistrano.rb", "Rakefile", "README.rdoc", "setup.rb", "test/cli/execute_test.rb", "test/cli/help_test.rb", "test/cli/options_test.rb", "test/cli/ui_test.rb", "test/cli_test.rb", "test/command_test.rb", "test/configuration/actions/file_transfer_test.rb", "test/configuration/actions/inspect_test.rb", "test/configuration/actions/invocation_test.rb", "test/configuration/callbacks_test.rb", "test/configuration/connections_test.rb", "test/configuration/execution_test.rb", "test/configuration/loading_test.rb", "test/configuration/namespace_dsl_test.rb", "test/configuration/roles_test.rb", "test/configuration/servers_test.rb", "test/configuration/variables_test.rb", "test/configuration_test.rb", "test/deploy/local_dependency_test.rb", "test/deploy/remote_dependency_test.rb", "test/deploy/scm/accurev_test.rb", "test/deploy/scm/base_test.rb", "test/deploy/scm/git_test.rb", "test/deploy/scm/mercurial_test.rb", "test/deploy/strategy/copy_test.rb", "test/extensions_test.rb", "test/fixtures/cli_integration.rb", "test/fixtures/config.rb", "test/fixtures/custom.rb", "test/logger_test.rb", "test/role_test.rb", "test/server_definition_test.rb", "test/shell_test.rb", "test/ssh_test.rb", "test/task_definition_test.rb", "test/transfer_test.rb", "test/utils.rb", "Manifest", "capistrano.gemspec", "test/deploy/scm/none_test.rb"]
|
15
|
-
s.has_rdoc = true
|
16
|
-
s.homepage = %q{http://www.capify.org}
|
17
|
-
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Capistrano", "--main", "README.rdoc"]
|
18
|
-
s.require_paths = ["lib"]
|
19
|
-
s.rubyforge_project = %q{capistrano}
|
20
|
-
s.rubygems_version = %q{1.2.0}
|
21
|
-
s.summary = %q{Simple. The way it should be.}
|
22
|
-
s.test_files = ["test/cli/execute_test.rb", "test/cli/help_test.rb", "test/cli/options_test.rb", "test/cli/ui_test.rb", "test/cli_test.rb", "test/command_test.rb", "test/configuration/actions/file_transfer_test.rb", "test/configuration/actions/inspect_test.rb", "test/configuration/actions/invocation_test.rb", "test/configuration/callbacks_test.rb", "test/configuration/connections_test.rb", "test/configuration/execution_test.rb", "test/configuration/loading_test.rb", "test/configuration/namespace_dsl_test.rb", "test/configuration/roles_test.rb", "test/configuration/servers_test.rb", "test/configuration/variables_test.rb", "test/configuration_test.rb", "test/deploy/local_dependency_test.rb", "test/deploy/remote_dependency_test.rb", "test/deploy/scm/accurev_test.rb", "test/deploy/scm/base_test.rb", "test/deploy/scm/git_test.rb", "test/deploy/scm/mercurial_test.rb", "test/deploy/scm/none_test.rb", "test/deploy/strategy/copy_test.rb", "test/extensions_test.rb", "test/logger_test.rb", "test/role_test.rb", "test/server_definition_test.rb", "test/shell_test.rb", "test/ssh_test.rb", "test/task_definition_test.rb", "test/transfer_test.rb"]
|
23
|
-
|
24
|
-
if s.respond_to? :specification_version then
|
25
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
26
|
-
s.specification_version = 2
|
27
|
-
|
28
|
-
if current_version >= 3 then
|
29
|
-
s.add_runtime_dependency(%q<net-ssh>, [">= 2.0.10"])
|
30
|
-
s.add_runtime_dependency(%q<net-sftp>, [">= 2.0.0"])
|
31
|
-
s.add_runtime_dependency(%q<net-scp>, [">= 1.0.0"])
|
32
|
-
s.add_runtime_dependency(%q<net-ssh-gateway>, [">= 1.0.0"])
|
33
|
-
s.add_runtime_dependency(%q<highline>, [">= 0"])
|
34
|
-
s.add_development_dependency(%q<echoe>, [">= 0"])
|
35
|
-
else
|
36
|
-
s.add_dependency(%q<net-ssh>, [">= 2.0.10"])
|
37
|
-
s.add_dependency(%q<net-sftp>, [">= 2.0.0"])
|
38
|
-
s.add_dependency(%q<net-scp>, [">= 1.0.0"])
|
39
|
-
s.add_dependency(%q<net-ssh-gateway>, [">= 1.0.0"])
|
40
|
-
s.add_dependency(%q<highline>, [">= 0"])
|
41
|
-
s.add_dependency(%q<echoe>, [">= 0"])
|
42
|
-
end
|
43
|
-
else
|
44
|
-
s.add_dependency(%q<net-ssh>, [">= 2.0.10"])
|
45
|
-
s.add_dependency(%q<net-sftp>, [">= 2.0.0"])
|
46
|
-
s.add_dependency(%q<net-scp>, [">= 1.0.0"])
|
47
|
-
s.add_dependency(%q<net-ssh-gateway>, [">= 1.0.0"])
|
48
|
-
s.add_dependency(%q<highline>, [">= 0"])
|
49
|
-
s.add_dependency(%q<echoe>, [">= 0"])
|
50
|
-
end
|
51
|
-
end
|
@@ -1,50 +0,0 @@
|
|
1
|
-
namespace :deploy do
|
2
|
-
|
3
|
-
desc <<-DESC
|
4
|
-
Run the migrate rake task. By default, it runs this in most recently \
|
5
|
-
deployed version of the app. However, you can specify a different release \
|
6
|
-
via the migrate_target variable, which must be one of :latest (for the \
|
7
|
-
default behavior), or :current (for the release indicated by the \
|
8
|
-
`current' symlink). Strings will work for those values instead of symbols, \
|
9
|
-
too. You can also specify additional environment variables to pass to rake \
|
10
|
-
via the migrate_env variable. Finally, you can specify the full path to the \
|
11
|
-
rake executable by setting the rake variable. The defaults are:
|
12
|
-
|
13
|
-
set :rake, "rake"
|
14
|
-
set :rails_env, "production"
|
15
|
-
set :migrate_env, ""
|
16
|
-
set :migrate_target, :latest
|
17
|
-
DESC
|
18
|
-
task :migrate, :roles => :db, :only => { :primary => true } do
|
19
|
-
rake = fetch(:rake, "rake")
|
20
|
-
rails_env = fetch(:rails_env, "production")
|
21
|
-
migrate_env = fetch(:migrate_env, "")
|
22
|
-
migrate_target = fetch(:migrate_target, :latest)
|
23
|
-
|
24
|
-
directory = case migrate_target.to_sym
|
25
|
-
when :current then current_path
|
26
|
-
when :latest then current_release
|
27
|
-
else raise ArgumentError, "unknown migration target #{migrate_target.inspect}"
|
28
|
-
end
|
29
|
-
|
30
|
-
run "cd #{directory}; #{rake} RAILS_ENV=#{rails_env} #{migrate_env} db:migrate"
|
31
|
-
end
|
32
|
-
|
33
|
-
desc <<-DESC
|
34
|
-
Deploy and run pending migrations. This will work similarly to the \
|
35
|
-
`deploy' task, but will also run any pending migrations (via the \
|
36
|
-
`deploy:migrate' task) prior to updating the symlink. Note that the \
|
37
|
-
update in this case it is not atomic, and transactions are not used, \
|
38
|
-
because migrations are not guaranteed to be reversible.
|
39
|
-
DESC
|
40
|
-
task :migrations do
|
41
|
-
set :migrate_target, :latest
|
42
|
-
update_code
|
43
|
-
migrate
|
44
|
-
symlink
|
45
|
-
restart
|
46
|
-
end
|
47
|
-
|
48
|
-
end
|
49
|
-
|
50
|
-
after('deploy:update_code', 'deploy:migrate')
|
@@ -1,21 +0,0 @@
|
|
1
|
-
_cset :shared_children, %w(system log pids)
|
2
|
-
|
3
|
-
after 'deploy:finalize_update' do
|
4
|
-
# mkdir -p is making sure that the directories are there for some SCM's that don't
|
5
|
-
# save empty folders
|
6
|
-
run <<-CMD
|
7
|
-
rm -rf #{latest_release}/log #{latest_release}/public/system #{latest_release}/tmp/pids &&
|
8
|
-
mkdir -p #{latest_release}/public &&
|
9
|
-
mkdir -p #{latest_release}/tmp &&
|
10
|
-
ln -s #{shared_path}/log #{latest_release}/log &&
|
11
|
-
ln -s #{shared_path}/system #{latest_release}/public/system &&
|
12
|
-
ln -s #{shared_path}/pids #{latest_release}/tmp/pids
|
13
|
-
CMD
|
14
|
-
|
15
|
-
if fetch(:normalize_asset_timestamps, true)
|
16
|
-
stamp = Time.now.utc.strftime("%Y%m%d%H%M.%S")
|
17
|
-
asset_paths = %w(images stylesheets javascripts).map { |p| "#{latest_release}/public/#{p}" }.join(" ")
|
18
|
-
run "find #{asset_paths} -exec touch -t #{stamp} {} ';'; true", :env => { "TZ" => "UTC" }
|
19
|
-
end
|
20
|
-
|
21
|
-
end
|
@@ -1,40 +0,0 @@
|
|
1
|
-
namespace :web do
|
2
|
-
desc <<-DESC
|
3
|
-
Present a maintenance page to visitors. Disables your application's web \
|
4
|
-
interface by writing a "maintenance.html" file to each web server. The \
|
5
|
-
servers must be configured to detect the presence of this file, and if \
|
6
|
-
it is present, always display it instead of performing the request.
|
7
|
-
|
8
|
-
By default, the maintenance page will just say the site is down for \
|
9
|
-
"maintenance", and will be back "shortly", but you can customize the \
|
10
|
-
page by specifying the REASON and UNTIL environment variables:
|
11
|
-
|
12
|
-
$ cap deploy:web:disable \\
|
13
|
-
REASON="hardware upgrade" \\
|
14
|
-
UNTIL="12pm Central Time"
|
15
|
-
|
16
|
-
Further customization will require that you write your own task.
|
17
|
-
DESC
|
18
|
-
task :disable, :roles => :web, :except => { :no_release => true } do
|
19
|
-
require 'erb'
|
20
|
-
on_rollback { run "rm #{shared_path}/system/maintenance.html" }
|
21
|
-
|
22
|
-
reason = ENV['REASON']
|
23
|
-
deadline = ENV['UNTIL']
|
24
|
-
|
25
|
-
template = File.read(File.join(File.dirname(__FILE__), "templates", "maintenance.rhtml"))
|
26
|
-
result = ERB.new(template).result(binding)
|
27
|
-
|
28
|
-
put result, "#{shared_path}/system/maintenance.html", :mode => 0644
|
29
|
-
end
|
30
|
-
|
31
|
-
desc <<-DESC
|
32
|
-
Makes the application web-accessible again. Removes the \
|
33
|
-
"maintenance.html" page generated by deploy:web:disable, which (if your \
|
34
|
-
web servers are configured correctly) will make your application \
|
35
|
-
web-accessible again.
|
36
|
-
DESC
|
37
|
-
task :enable, :roles => :web, :except => { :no_release => true } do
|
38
|
-
run "rm #{shared_path}/system/maintenance.html"
|
39
|
-
end
|
40
|
-
end
|