capistrano 2.5.18 → 2.5.20
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +60 -42
- data/Gemfile +17 -0
- data/README.mdown +65 -0
- data/Rakefile +10 -14
- data/VERSION +1 -1
- data/bin/capify +3 -3
- data/lib/capistrano/command.rb +6 -3
- data/lib/capistrano/configuration/actions/file_transfer.rb +1 -1
- data/lib/capistrano/recipes/deploy/remote_dependency.rb +6 -0
- data/lib/capistrano/recipes/deploy/scm/cvs.rb +2 -1
- data/lib/capistrano/recipes/deploy/scm/git.rb +1 -1
- data/lib/capistrano/recipes/deploy/scm/subversion.rb +1 -1
- data/lib/capistrano/recipes/deploy/strategy/base.rb +11 -2
- data/lib/capistrano/recipes/deploy/strategy/copy.rb +13 -8
- data/lib/capistrano/recipes/deploy/strategy/remote_cache.rb +1 -0
- data/lib/capistrano/recipes/deploy.rb +27 -19
- data/test/configuration/actions/file_transfer_test.rb +3 -3
- data/test/deploy/remote_dependency_test.rb +22 -1
- data/test/deploy/scm/git_test.rb +2 -2
- data/test/deploy/strategy/copy_test.rb +16 -16
- metadata +148 -34
- data/.gitignore +0 -9
- data/README +0 -102
data/CHANGELOG
CHANGED
@@ -1,18 +1,36 @@
|
|
1
|
-
|
1
|
+
## 2.5.20 / March 16 2011
|
2
|
+
|
3
|
+
* `deploy:migrations` will now always operate on the latest_release, not
|
4
|
+
current_release (Mike Vincent)
|
5
|
+
* Adds a check for the presence of `rsync` when using the copy strategy with `rsync`. (Chris Griego)
|
6
|
+
* Do not try to look up the `:release_path` on servers which are defined `:no_release` (Chris Griego)
|
7
|
+
* Tiny patch to the `CVS` SCM code to be Ruby 1.9 compatible (Martin Carpenter)
|
8
|
+
* Changed the default `Git` submodule behaviour to use `--recursive`, Lighthouse Issue #176. (Lee Hambley)
|
9
|
+
* `:public_children` can now be `set()`, the default is unchanged, thanks (Chris Griego)
|
10
|
+
* Fixing the load path in the default `Capfile` to search vendored/unpacked Gems. Lighthouse Issue #174 (Mari Carmen/Rafael García)
|
11
|
+
* Adds a `maintenance_basename` variable (default value is `maintenance`) to allow you to set the maintenance page name (Celestino Gomes)
|
12
|
+
* Spelling fixes in inline-documentation (Tom Copeland)
|
13
|
+
* Make `zip` and `tar` handle symlinks the same way (zip follows symlinks by default, tar needs the option `-h`) (Ross Cooperman)
|
14
|
+
|
15
|
+
## 2.5.19 / June 21, 2010
|
16
|
+
|
17
|
+
* Small bug fixes, no improvements for people who weren't experiencing problems anyway.
|
18
|
+
|
19
|
+
## 2.5.18 / March 14, 2010
|
2
20
|
|
3
21
|
Small fix for rolling back if a shell scripts exits non-zero; enabled a rollback if git (or other) externals fail during the deploy.
|
4
22
|
|
5
23
|
* #151 check return code status of system command to create local copy and rollback if not 0 (David King)
|
6
24
|
|
7
|
-
|
25
|
+
## 2.5.17 / February 27, 2010
|
8
26
|
|
9
27
|
Various small bug fixes.
|
10
28
|
|
11
|
-
|
29
|
+
## 2.5.16 / February 14, 2010
|
12
30
|
|
13
31
|
Fixed a small regression in 2.5.15
|
14
32
|
|
15
|
-
|
33
|
+
## 2.5.15 / 14 February 2010
|
16
34
|
|
17
35
|
Fixes a feature request not to overwrite roles when using the ROLES environmental variable.
|
18
36
|
|
@@ -20,34 +38,34 @@ Fixes a feature request not to overwrite roles when using the ROLES environmenta
|
|
20
38
|
* Removed the `upgrade` file as it has been a couple of years since 1.x was in the wild.
|
21
39
|
* Slight internal re-factor of the way we calculate the `version`
|
22
40
|
|
23
|
-
|
41
|
+
## 2.5.14 / 18 January 2010
|
24
42
|
|
25
43
|
Fixes a low-value bug, thanks to Chris G for the well submitted patch:
|
26
44
|
|
27
45
|
* #139 - Improves consistency of variable lookup, scm variables with a local_ prefix will be honoured with priority locally (Chris Griego)
|
28
46
|
|
29
|
-
|
47
|
+
## 2.5.13 / 6 January 2010
|
30
48
|
|
31
49
|
* Small maintenance release:
|
32
50
|
|
33
51
|
* #118 - Modified CLI test to not load user or system configuration file (Emily Price)
|
34
52
|
* #88 - Re-fixed a problem here, massive apologies to all concerned. (Hangover from 2.5.12)
|
35
53
|
|
36
|
-
|
54
|
+
## 2.5.12 / 5 January 2010
|
37
55
|
|
38
56
|
* Tweak the directory version listing (caused a lot of problems, please upgrade immediately)
|
39
57
|
|
40
|
-
|
58
|
+
## 2.5.11 / December 2009
|
41
59
|
|
42
60
|
* Deprecations and other small changes
|
43
61
|
|
44
|
-
|
62
|
+
## 2.5.10 / 3 November 2009
|
45
63
|
|
46
64
|
* Fixes Darcs remote repository problem when using the copy strategy [Alex `regularfry` Young]
|
47
65
|
* Documentation improvements for embedding Capistrano [Lee Hambley]
|
48
66
|
* Fixes ticket #95 -formally deprecating the before_something and after_something methods [Lee Hambley]
|
49
67
|
|
50
|
-
|
68
|
+
## 2.5.9 / 1 August 2009
|
51
69
|
|
52
70
|
* Adds support for customizing which `tar` command to use. [Jeremy Wells]
|
53
71
|
|
@@ -62,11 +80,11 @@ Fixes a low-value bug, thanks to Chris G for the well submitted patch:
|
|
62
80
|
* Improved web:disable task, now suggests a .htaccess block to use suggested by Rafael García
|
63
81
|
* Includes more logger options (can now select stdout, stderr of a file) [Rafael García]
|
64
82
|
|
65
|
-
|
83
|
+
## 2.5.8 / July 2009
|
66
84
|
|
67
85
|
* Fixes a problem in 2.5.7 where deploy:finalize_update had been badly merged.
|
68
86
|
|
69
|
-
|
87
|
+
## 2.5.6 & 2.5.7 / July 2009
|
70
88
|
|
71
89
|
* 2.5.7 masks a broken 2.5.6 release that was accidentally mirrored via Rubyforge.
|
72
90
|
|
@@ -80,12 +98,12 @@ Fixes a low-value bug, thanks to Chris G for the well submitted patch:
|
|
80
98
|
|
81
99
|
* Capify now creates the config directory in directories without one.
|
82
100
|
|
83
|
-
|
101
|
+
## 2.5.5 / 24 Feb 2009
|
84
102
|
|
85
103
|
* Make sure role(:foo) actually declares an (empty) role for :foo, even without server arguments [Jamis Buck]
|
86
104
|
|
87
105
|
|
88
|
-
|
106
|
+
## 2.5.4 / 4 Feb 2009
|
89
107
|
|
90
108
|
* When using rsync with the remote_cache strategy include -t switch to preserve file times [Kevin McCarthy]
|
91
109
|
|
@@ -100,7 +118,7 @@ Fixes a low-value bug, thanks to Chris G for the well submitted patch:
|
|
100
118
|
* Add supported environment variables to -H output [François Beausoleil]
|
101
119
|
|
102
120
|
|
103
|
-
|
121
|
+
## 2.5.3 / December 6, 2008
|
104
122
|
|
105
123
|
* Make previous_release return nil if there is no previous release [Mathias Meyer]
|
106
124
|
|
@@ -113,12 +131,12 @@ Fixes a low-value bug, thanks to Chris G for the well submitted patch:
|
|
113
131
|
* Fix issue with git SCM that caused "Unable to resolve revision" errors when there was trailing whitespace in git's output [Mark Zuneska, Daniel Berlinger and Evan Closson]
|
114
132
|
|
115
133
|
|
116
|
-
|
134
|
+
## 2.5.2 / November 13, 2008
|
117
135
|
|
118
136
|
* Fix issue with git SCM that caused "Unable to resolve revision for 'HEAD'" errors on deploy [Jamis Buck]
|
119
137
|
|
120
138
|
|
121
|
-
|
139
|
+
## 2.5.1 / November 7, 2008
|
122
140
|
|
123
141
|
* Add -t (--tools) switch for better task lists for external tools [Jamis Buck]
|
124
142
|
|
@@ -147,7 +165,7 @@ Fixes a low-value bug, thanks to Chris G for the well submitted patch:
|
|
147
165
|
* Ruby 1.9 compatibility [Jamis Buck]
|
148
166
|
|
149
167
|
|
150
|
-
|
168
|
+
## 2.5.0 / August 28, 2008
|
151
169
|
|
152
170
|
* Allow :gateway to be set to an array, in which case a chain of tunnels is created [Kerry Buckley]
|
153
171
|
|
@@ -186,17 +204,17 @@ Fixes a low-value bug, thanks to Chris G for the well submitted patch:
|
|
186
204
|
* Added -n/--dry-run switch, to display but not execute remote tasks [Paul Gross]
|
187
205
|
|
188
206
|
|
189
|
-
|
207
|
+
## 2.4.3 / June 28, 2008
|
190
208
|
|
191
209
|
* Fix gem dependencies so gem actually understands them [Jamis Buck]
|
192
210
|
|
193
211
|
|
194
|
-
|
212
|
+
## 2.4.2 / June 27, 2008
|
195
213
|
|
196
214
|
* Specify gem dependencies in rakefile [Jamis Buck]
|
197
215
|
|
198
216
|
|
199
|
-
|
217
|
+
## 2.4.1 / June 27, 2008
|
200
218
|
|
201
219
|
* Use Echoe to manage the Rakefile [Jamis Buck]
|
202
220
|
|
@@ -205,12 +223,12 @@ Fixes a low-value bug, thanks to Chris G for the well submitted patch:
|
|
205
223
|
* Changed capture() helper to not raise an exception on error, but to warn instead [Jeff Forcier]
|
206
224
|
|
207
225
|
|
208
|
-
|
226
|
+
## 2.4.0 / June 13, 2008
|
209
227
|
|
210
228
|
* Added :normalize_asset_timestamps option to deployment, defaulting to true, which allows asset timestamping to be disabled [John Trupiano]
|
211
229
|
|
212
230
|
|
213
|
-
|
231
|
+
## 2.4.0 Preview Release #1 (2.3.101) / June 5, 2008
|
214
232
|
|
215
233
|
* Only make deploy:start, deploy:stop, and deploy:restart try sudo as :runner. The other sudo-enabled tasks (deploy:setup, deploy:cleanup, etc.) will now use the :admin_runner user (which by default is unset). [Jamis Buck]
|
216
234
|
|
@@ -255,7 +273,7 @@ Fixes a low-value bug, thanks to Chris G for the well submitted patch:
|
|
255
273
|
* Add debug switch for enabling conditional execution of commands [Mark Imbriaco]
|
256
274
|
|
257
275
|
|
258
|
-
|
276
|
+
## 2.3.0 / May 2, 2008
|
259
277
|
|
260
278
|
* Make deploy:setup obey the :use_sudo and :runner directives, and generalize the :use_sudo and :runner options into a try_sudo() helper method [Jamis Buck]
|
261
279
|
|
@@ -282,7 +300,7 @@ Fixes a low-value bug, thanks to Chris G for the well submitted patch:
|
|
282
300
|
* Improved "copy" strategy supports local caching and pattern exclusion (via :copy_cache and :copy_exclude variables) [Jamis Buck]
|
283
301
|
|
284
302
|
|
285
|
-
|
303
|
+
## 2.2.0 / February 27, 2008
|
286
304
|
|
287
305
|
* Fix git submodule support to init on sync [halorgium]
|
288
306
|
|
@@ -329,7 +347,7 @@ Fixes a low-value bug, thanks to Chris G for the well submitted patch:
|
|
329
347
|
* Prepare for Net::SSH v2 by making sure Capistrano only tries to load Net::SSH versions less than 1.99.0 [Jamis Buck]
|
330
348
|
|
331
349
|
|
332
|
-
|
350
|
+
## 2.1.0 / October 14, 2007
|
333
351
|
|
334
352
|
* Default to 0664 instead of 0660 on upload [Jamis Buck]
|
335
353
|
|
@@ -350,7 +368,7 @@ Fixes a low-value bug, thanks to Chris G for the well submitted patch:
|
|
350
368
|
* Use the --password switch for subversion by default, but add :scm_prefer_prompt variable (defaults to false) [Jamis Buck]
|
351
369
|
|
352
370
|
|
353
|
-
|
371
|
+
## 2.0.100 (2.1 Preview 1) / September 1, 2007
|
354
372
|
|
355
373
|
* capify-generated Capfile will autoload all recipes from vendor/plugins/*/recipes/*.rb [Graeme Mathieson]
|
356
374
|
|
@@ -383,7 +401,7 @@ Fixes a low-value bug, thanks to Chris G for the well submitted patch:
|
|
383
401
|
* Change the "-h" output so that it does not say that "-q" is the default [Jamis Buck]
|
384
402
|
|
385
403
|
|
386
|
-
|
404
|
+
## 2.0.0 / July 21, 2007
|
387
405
|
|
388
406
|
* Make the "no matching servers" error more sane [halorgium]
|
389
407
|
|
@@ -412,7 +430,7 @@ Fixes a low-value bug, thanks to Chris G for the well submitted patch:
|
|
412
430
|
* Spelling corrections in docs [Tim Carey-Smith, Giles Bowkett]
|
413
431
|
|
414
432
|
|
415
|
-
|
433
|
+
## 1.99.3 (2.0 Preview 4) / June 28, 2007
|
416
434
|
|
417
435
|
* Don't break task descriptions on a period that appears in the middle of a sentence [Jamis Buck]
|
418
436
|
|
@@ -445,7 +463,7 @@ Fixes a low-value bug, thanks to Chris G for the well submitted patch:
|
|
445
463
|
* Make sure symlink and finalize_update tasks reference the most recent release when called by themselves [Jamis Buck]
|
446
464
|
|
447
465
|
|
448
|
-
|
466
|
+
## 1.99.2 (2.0 Preview 3) / June 15, 2007
|
449
467
|
|
450
468
|
* CVS SCM module [Brian Phillips]
|
451
469
|
|
@@ -470,7 +488,7 @@ Fixes a low-value bug, thanks to Chris G for the well submitted patch:
|
|
470
488
|
* Add :default_environment variable, which is applied to every command
|
471
489
|
|
472
490
|
|
473
|
-
|
491
|
+
## 1.99.1 (2.0 Preview 2) / May 10, 2007
|
474
492
|
|
475
493
|
* Fix some documentation typos [eventualbuddha]
|
476
494
|
|
@@ -505,7 +523,7 @@ Fixes a low-value bug, thanks to Chris G for the well submitted patch:
|
|
505
523
|
* Make the copy strategy check out to a temporary directory [Jamis Buck]
|
506
524
|
|
507
525
|
|
508
|
-
|
526
|
+
## 1.99.0 (2.0 Preview 1) / April 24, 2007
|
509
527
|
|
510
528
|
* Add `capify' script to make it easier to prepare a project for deployment using cap [Jamis Buck]
|
511
529
|
|
@@ -526,7 +544,7 @@ Fixes a low-value bug, thanks to Chris G for the well submitted patch:
|
|
526
544
|
* Merged the Configuration and Actor classes, performed various other massive refactorings of the code [Jamis Buck]
|
527
545
|
|
528
546
|
|
529
|
-
|
547
|
+
## 1.4.1 / February 24, 2007
|
530
548
|
|
531
549
|
* Use the no-auth-cache option with subversion so that username/password tokens do not get cached by capistrano usage [jonathan]
|
532
550
|
|
@@ -537,7 +555,7 @@ Fixes a low-value bug, thanks to Chris G for the well submitted patch:
|
|
537
555
|
* Add :env option to 'run' (and friends) so that you can specify environment variables to be injected into the new process' environment [Mathieu Lajugie]
|
538
556
|
|
539
557
|
|
540
|
-
|
558
|
+
## 1.4.0 / February 3, 2007
|
541
559
|
|
542
560
|
* Use the auth info for subversion more consistently [Jamis Buck]
|
543
561
|
|
@@ -564,12 +582,12 @@ Fixes a low-value bug, thanks to Chris G for the well submitted patch:
|
|
564
582
|
* Fix off-by-one bug in show_tasks width-computation [NeilW]
|
565
583
|
|
566
584
|
|
567
|
-
|
585
|
+
## 1.3.1 / January 5, 2007
|
568
586
|
|
569
587
|
* Fix connection problems when using gateways [Ezra Zygmuntowicz]
|
570
588
|
|
571
589
|
|
572
|
-
|
590
|
+
## 1.3.0 / December 23, 2006
|
573
591
|
|
574
592
|
* Deprecate rake integration in favor of invoking `cap' directly [Jamis Buck]
|
575
593
|
|
@@ -600,7 +618,7 @@ Fixes a low-value bug, thanks to Chris G for the well submitted patch:
|
|
600
618
|
* Added :as option to sudo, so you can specify who the command is executed as [Mark Imbriaco]
|
601
619
|
|
602
620
|
|
603
|
-
|
621
|
+
## 1.2.0 / September 14, 2006
|
604
622
|
|
605
623
|
* Add experimental 'shell' task [Jamis Buck]
|
606
624
|
|
@@ -684,7 +702,7 @@ Fixes a low-value bug, thanks to Chris G for the well submitted patch:
|
|
684
702
|
* Fix operator precedence problem in script for touching the revisions.log #3223 [jason.garber@emu.edu]
|
685
703
|
|
686
704
|
|
687
|
-
|
705
|
+
## 1.1.0 / March 6th, 2006
|
688
706
|
|
689
707
|
* Simplify the generated capistrano.rake file, and make it easier to customize
|
690
708
|
|
@@ -697,12 +715,12 @@ Fixes a low-value bug, thanks to Chris G for the well submitted patch:
|
|
697
715
|
* Look for config/deploy.rb, capfile, and Capfile by default
|
698
716
|
|
699
717
|
|
700
|
-
|
718
|
+
## 1.0.1 / February 20th, 2006
|
701
719
|
|
702
720
|
* Fix broken switchtower_invoke function in switchtower.rake (missing require statement)
|
703
721
|
|
704
722
|
|
705
|
-
|
723
|
+
## 1.0.0 / Feburary 18th, 2006
|
706
724
|
|
707
725
|
* Make CVS module's :local value default to "."
|
708
726
|
|
@@ -751,7 +769,7 @@ Fixes a low-value bug, thanks to Chris G for the well submitted patch:
|
|
751
769
|
* Set :actor key on SSH channel instances
|
752
770
|
|
753
771
|
|
754
|
-
|
772
|
+
## 0.10.0 / January 2nd, 2006
|
755
773
|
|
756
774
|
* Handle ssh password prompts like "someone's password:"
|
757
775
|
|
@@ -790,7 +808,7 @@ Fixes a low-value bug, thanks to Chris G for the well submitted patch:
|
|
790
808
|
* Require Net::SSH 1.0.5
|
791
809
|
|
792
810
|
|
793
|
-
|
811
|
+
## 0.9.0 / October 18th, 2005
|
794
812
|
|
795
813
|
* Use process reaper instead of custom reap script for restarting
|
796
814
|
|
data/Gemfile
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
#
|
2
|
+
# This is the gemfile for local development
|
3
|
+
# these are the requirements for running
|
4
|
+
# the test suite.
|
5
|
+
#
|
6
|
+
|
7
|
+
source :gemcutter
|
8
|
+
|
9
|
+
gem 'net-ssh'
|
10
|
+
gem 'net-ssh-gateway'
|
11
|
+
gem 'net-sftp'
|
12
|
+
gem 'net-scp'
|
13
|
+
gem 'highline'
|
14
|
+
|
15
|
+
group :test do
|
16
|
+
gem "mocha"
|
17
|
+
end
|
data/README.mdown
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
## Capistrano
|
2
|
+
|
3
|
+
Capistrano is a utility and framework for executing commands in parallel on multiple remote machines, via SSH. It uses a simple DSL (borrowed in part from Rake, [[http://rake.rubyforge.org/]]) that allows you to define _tasks_, which may be applied to machines in certain roles. It also supports tunneling connections via some gateway machine to allow operations to be performed behind VPN's and firewalls.
|
4
|
+
|
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.
|
6
|
+
|
7
|
+
## Documentation
|
8
|
+
|
9
|
+
* [[http://github.com/capistrano/capistrano/wiki/Documentation-v2.x]]
|
10
|
+
|
11
|
+
## DEPENDENCIES
|
12
|
+
|
13
|
+
* [[Net::SSH|http://net-ssh.rubyforge.org]]
|
14
|
+
* [[Net::SFTP|http://net-ssh.rubyforge.org]]
|
15
|
+
* [[Net::SCP|http://net-ssh.rubyforge.org]]
|
16
|
+
* [[Net::SSH::Gateway|http://net-ssh.rubyforge.org]]
|
17
|
+
* [[HighLine|http://highline.rubyforge.org]]
|
18
|
+
|
19
|
+
If you want to run the tests, you'll also need to have the following dependencies installed:
|
20
|
+
|
21
|
+
* Echoe (for the Rakefile)
|
22
|
+
* Mocha (http://mocha.rubyforge.org)
|
23
|
+
|
24
|
+
## ASSUMPTIONS
|
25
|
+
|
26
|
+
Capistrano is "opinionated software", which means it has very firm ideas about how things ought to be done, and tries to force those ideas on you. Some of the assumptions behind these opinions are:
|
27
|
+
|
28
|
+
* You are using SSH to access the remote servers.
|
29
|
+
* You either have the same password to all target machines, or you have public keys in place to allow passwordless access to them.
|
30
|
+
|
31
|
+
Do not expect these assumptions to change.
|
32
|
+
|
33
|
+
## USAGE
|
34
|
+
|
35
|
+
In general, you'll use Capistrano as follows:
|
36
|
+
|
37
|
+
* Create a recipe file ("capfile" or "Capfile").
|
38
|
+
* Use the `cap` script to execute your recipe.
|
39
|
+
|
40
|
+
Use the `cap` script as follows:
|
41
|
+
|
42
|
+
cap sometask
|
43
|
+
|
44
|
+
By default, the script will look for a file called one of `capfile` or `Capfile`. The `someaction` text indicates which task to execute. You can do "cap -h" to see all the available options and "cap -T" to see all the available tasks.
|
45
|
+
|
46
|
+
## LICENSE:
|
47
|
+
|
48
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
49
|
+
a copy of this software and associated documentation files (the
|
50
|
+
'Software'), to deal in the Software without restriction, including
|
51
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
52
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
53
|
+
permit persons to whom the Software is furnished to do so, subject to
|
54
|
+
the following conditions:
|
55
|
+
|
56
|
+
The above copyright notice and this permission notice shall be
|
57
|
+
included in all copies or substantial portions of the Software.
|
58
|
+
|
59
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
60
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
61
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
62
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
63
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
64
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
65
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
CHANGED
@@ -1,4 +1,11 @@
|
|
1
|
-
require
|
1
|
+
require 'rake/testtask'
|
2
|
+
Rake::TestTask.new(:test) do |test|
|
3
|
+
test.libs << 'lib' << 'test'
|
4
|
+
test.pattern = 'test/**/*_test.rb'
|
5
|
+
test.verbose = true
|
6
|
+
end
|
7
|
+
|
8
|
+
task :default => :test
|
2
9
|
|
3
10
|
begin
|
4
11
|
require 'jeweler'
|
@@ -6,7 +13,7 @@ begin
|
|
6
13
|
gem.version
|
7
14
|
gem.name = "capistrano"
|
8
15
|
gem.executables = %W(capify cap)
|
9
|
-
gem.summary = %Q{Capistrano
|
16
|
+
gem.summary = %Q{Capistrano - Welcome to easy deployment with Ruby over SSH}
|
10
17
|
gem.description = %Q{Capistrano is a utility and framework for executing commands in parallel on multiple remote machines, via SSH.}
|
11
18
|
gem.homepage = "http://github.com/capistrano/capistrano"
|
12
19
|
gem.email = [ "jamis@jamisbuck.org", "lee.hambley@gmail.com" ]
|
@@ -20,15 +27,4 @@ begin
|
|
20
27
|
end
|
21
28
|
rescue LoadError
|
22
29
|
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
|
23
|
-
end
|
24
|
-
|
25
|
-
require 'rake/testtask'
|
26
|
-
Rake::TestTask.new(:test) do |test|
|
27
|
-
test.libs << 'lib' << 'test'
|
28
|
-
test.pattern = 'test/**/*_test.rb'
|
29
|
-
test.verbose = true
|
30
|
-
end
|
31
|
-
|
32
|
-
task :test => :check_dependencies
|
33
|
-
task :default => :test
|
34
|
-
|
30
|
+
end
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.5.
|
1
|
+
2.5.20
|
data/bin/capify
CHANGED
@@ -38,7 +38,7 @@ end
|
|
38
38
|
files = {
|
39
39
|
"Capfile" => unindent(<<-FILE),
|
40
40
|
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
|
41
|
-
Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
|
41
|
+
Dir['vendor/gems/*/recipes/*.rb','vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
|
42
42
|
|
43
43
|
load 'config/deploy' # remove this line to skip loading any of the default tasks
|
44
44
|
FILE
|
@@ -54,10 +54,10 @@ role :app, "your app-server here" # This may be the sam
|
|
54
54
|
role :db, "your primary db-server here", :primary => true # This is where Rails migrations will run
|
55
55
|
role :db, "your slave db-server here"
|
56
56
|
|
57
|
-
#
|
58
|
-
# if you\'re still using the script/reapear helper you will need
|
57
|
+
# if you\'re still using the script/reaper helper you will need
|
59
58
|
# these http://github.com/rails/irs_process_scripts
|
60
59
|
|
60
|
+
# If you are using Passenger mod_rails uncomment this:
|
61
61
|
# namespace :deploy do
|
62
62
|
# task :start do ; end
|
63
63
|
# task :stop do ; end
|
data/lib/capistrano/command.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'benchmark'
|
1
2
|
require 'capistrano/errors'
|
2
3
|
require 'capistrano/processable'
|
3
4
|
|
@@ -159,11 +160,13 @@ module Capistrano
|
|
159
160
|
# fails (non-zero return code) on any of the hosts, this will raise a
|
160
161
|
# Capistrano::CommandError.
|
161
162
|
def process!
|
162
|
-
|
163
|
-
|
163
|
+
elapsed = Benchmark.realtime do
|
164
|
+
loop do
|
165
|
+
break unless process_iteration { @channels.any? { |ch| !ch[:closed] } }
|
166
|
+
end
|
164
167
|
end
|
165
168
|
|
166
|
-
logger.trace "command finished" if logger
|
169
|
+
logger.trace "command finished in #{(elapsed * 1000).round}ms" if logger
|
167
170
|
|
168
171
|
if (failed = @channels.select { |ch| ch[:status] != 0 }).any?
|
169
172
|
commands = failed.inject({}) { |map, ch| (map[ch[:command]] ||= []) << ch[:server]; map }
|
@@ -43,6 +43,12 @@ module Capistrano
|
|
43
43
|
self
|
44
44
|
end
|
45
45
|
|
46
|
+
def deb(name, version, options={})
|
47
|
+
@message ||= "package `#{name}' #{version} could not be found"
|
48
|
+
try("dpkg -s #{name} | grep '^Version: #{version}'", options)
|
49
|
+
self
|
50
|
+
end
|
51
|
+
|
46
52
|
def match(command, expect, options={})
|
47
53
|
expect = Regexp.new(Regexp.escape(expect.to_s)) unless expect.is_a?(Regexp)
|
48
54
|
|
@@ -69,7 +69,8 @@ module Capistrano
|
|
69
69
|
def query_revision(revision)
|
70
70
|
return revision if revision_type(revision) == :date
|
71
71
|
revision = yield(scm(cvs_root, :log, "-r#{revision}")).
|
72
|
-
|
72
|
+
split("\n").
|
73
|
+
select { |line| line =~ /^date:/ }.
|
73
74
|
map { |line| line[/^date: (.*?);/, 1] }.
|
74
75
|
sort.last + " UTC"
|
75
76
|
return revision
|
@@ -152,7 +152,7 @@ module Capistrano
|
|
152
152
|
if variable(:git_enable_submodules)
|
153
153
|
execute << "#{git} submodule #{verbose} init"
|
154
154
|
execute << "#{git} submodule #{verbose} sync"
|
155
|
-
execute << "#{git} submodule #{verbose} update"
|
155
|
+
execute << "#{git} submodule #{verbose} update --recursive"
|
156
156
|
end
|
157
157
|
|
158
158
|
execute.join(" && ")
|
@@ -52,7 +52,7 @@ module Capistrano
|
|
52
52
|
# executed (svn info), and will extract the revision from the response.
|
53
53
|
def query_revision(revision)
|
54
54
|
return revision if revision =~ /^\d+$/
|
55
|
-
command = scm(:info, repository, authentication, "-r#{revision}")
|
55
|
+
command = scm(:info, arguments, repository, authentication, "-r#{revision}")
|
56
56
|
result = yield(command)
|
57
57
|
yaml = YAML.load(result)
|
58
58
|
raise "tried to run `#{command}' and got unexpected result #{result.inspect}" unless Hash === yaml
|
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'benchmark'
|
1
2
|
require 'capistrano/recipes/deploy/dependencies'
|
2
3
|
|
3
4
|
module Capistrano
|
@@ -49,16 +50,24 @@ module Capistrano
|
|
49
50
|
# A wrapper for Kernel#system that logs the command being executed.
|
50
51
|
def system(*args)
|
51
52
|
cmd = args.join(' ')
|
53
|
+
result = nil
|
52
54
|
if RUBY_PLATFORM =~ /win32/
|
53
55
|
cmd = cmd.split(/\s+/).collect {|w| w.match(/^[\w+]+:\/\//) ? w : w.gsub('/', '\\') }.join(' ') # Split command by spaces, change / by \\ unless element is a some+thing://
|
54
56
|
cmd.gsub!(/^cd /,'cd /D ') # Replace cd with cd /D
|
55
57
|
cmd.gsub!(/&& cd /,'&& cd /D ') # Replace cd with cd /D
|
56
58
|
logger.trace "executing locally: #{cmd}"
|
57
|
-
|
59
|
+
elapsed = Benchmark.realtime do
|
60
|
+
result = super(cmd)
|
61
|
+
end
|
58
62
|
else
|
59
63
|
logger.trace "executing locally: #{cmd}"
|
60
|
-
|
64
|
+
elapsed = Benchmark.realtime do
|
65
|
+
result = super
|
66
|
+
end
|
61
67
|
end
|
68
|
+
|
69
|
+
logger.trace "command finished in #{(elapsed * 1000).round}ms"
|
70
|
+
result
|
62
71
|
end
|
63
72
|
|
64
73
|
private
|
@@ -86,7 +86,7 @@ module Capistrano
|
|
86
86
|
if copy_exclude.any?
|
87
87
|
logger.debug "processing exclusions..."
|
88
88
|
if copy_exclude.any?
|
89
|
-
copy_exclude.each do |pattern|
|
89
|
+
copy_exclude.each do |pattern|
|
90
90
|
delete_list = Dir.glob(File.join(destination, pattern), File::FNM_DOTMATCH)
|
91
91
|
# avoid the /.. trap that deletes the parent directories
|
92
92
|
delete_list.delete_if { |dir| dir =~ /\/\.\.$/ }
|
@@ -101,8 +101,7 @@ module Capistrano
|
|
101
101
|
logger.trace "compressing #{destination} to #{filename}"
|
102
102
|
Dir.chdir(tmpdir) { system(compress(File.basename(destination), File.basename(filename)).join(" ")) }
|
103
103
|
|
104
|
-
|
105
|
-
run "cd #{configuration[:releases_path]} && #{decompress(remote_filename).join(" ")} && rm #{remote_filename}"
|
104
|
+
distribute!
|
106
105
|
ensure
|
107
106
|
FileUtils.rm filename rescue nil
|
108
107
|
FileUtils.rm_rf destination rescue nil
|
@@ -184,21 +183,21 @@ module Capistrano
|
|
184
183
|
# Commands are arrays, where the first element is the utility to be
|
185
184
|
# used to perform the compression or decompression.
|
186
185
|
Compression = Struct.new(:extension, :compress_command, :decompress_command)
|
187
|
-
|
186
|
+
|
188
187
|
# The compression method to use, defaults to :gzip.
|
189
188
|
def compression
|
190
189
|
remote_tar = configuration[:copy_remote_tar] || 'tar'
|
191
190
|
local_tar = configuration[:copy_local_tar] || 'tar'
|
192
|
-
|
191
|
+
|
193
192
|
type = configuration[:copy_compression] || :gzip
|
194
193
|
case type
|
195
|
-
when :gzip, :gz then Compression.new("tar.gz", [local_tar, '
|
196
|
-
when :bzip2, :bz2 then Compression.new("tar.bz2", [local_tar, '
|
194
|
+
when :gzip, :gz then Compression.new("tar.gz", [local_tar, 'chzf'], [remote_tar, 'xzf'])
|
195
|
+
when :bzip2, :bz2 then Compression.new("tar.bz2", [local_tar, 'chjf'], [remote_tar, 'xjf'])
|
197
196
|
when :zip then Compression.new("zip", %w(zip -qr), %w(unzip -q))
|
198
197
|
else raise ArgumentError, "invalid compression type #{type.inspect}"
|
199
198
|
end
|
200
199
|
end
|
201
|
-
|
200
|
+
|
202
201
|
# Returns the command necessary to compress the given directory
|
203
202
|
# into the given file.
|
204
203
|
def compress(directory, file)
|
@@ -211,6 +210,12 @@ module Capistrano
|
|
211
210
|
def decompress(file)
|
212
211
|
compression.decompress_command + [file]
|
213
212
|
end
|
213
|
+
|
214
|
+
# Distributes the file to the remote servers
|
215
|
+
def distribute!
|
216
|
+
upload(filename, remote_filename)
|
217
|
+
run "cd #{configuration[:releases_path]} && #{decompress(remote_filename).join(" ")} && rm #{remote_filename}"
|
218
|
+
end
|
214
219
|
end
|
215
220
|
|
216
221
|
end
|