Permalink
Browse files

update Capistrano to 2.5.0 and fix tests

git-svn-id: svn+ssh://phoenix/srv/svn/webistrano/trunk@129 e1153f85-6c6c-dc11-afa8-0013d3c39b19
  • Loading branch information...
1 parent b8c3d98 commit ccbcff023c88dbd37f1655707aba5c46675eb1bb jweiss committed Sep 16, 2008
Showing with 766 additions and 297 deletions.
  1. +2 −0 CHANGELOG.txt
  2. +1 −1 app/views/users/_form.html.erb
  3. +4 −4 test/unit/webistrano_deployer_test.rb
  4. +0 −155 vendor/plugins/capistrano-2.4.3/lib/capistrano/command.rb
  5. +39 −0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/CHANGELOG.rdoc
  6. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/Manifest
  7. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/README.rdoc
  8. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/Rakefile
  9. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/bin/cap
  10. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/bin/capify
  11. +5 −5 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/capistrano.gemspec
  12. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/examples/sample.rb
  13. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/lib/capistrano.rb
  14. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/lib/capistrano/callback.rb
  15. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/lib/capistrano/cli.rb
  16. +1 −0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/lib/capistrano/cli/execute.rb
  17. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/lib/capistrano/cli/help.rb
  18. +6 −0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/lib/capistrano/cli/help.txt
  19. +26 −0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/lib/capistrano/cli/options.rb
  20. +0 −1 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/lib/capistrano/cli/ui.rb
  21. +283 −0 vendor/plugins/capistrano-2.5.0/lib/capistrano/command.rb
  22. +2 −1 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/lib/capistrano/configuration.rb
  23. 0 ...ugins/{capistrano-2.4.3 → capistrano-2.5.0}/lib/capistrano/configuration/actions/file_transfer.rb
  24. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/lib/capistrano/configuration/actions/inspect.rb
  25. +38 −7 .../plugins/{capistrano-2.4.3 → capistrano-2.5.0}/lib/capistrano/configuration/actions/invocation.rb
  26. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/lib/capistrano/configuration/callbacks.rb
  27. +12 −6 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/lib/capistrano/configuration/connections.rb
  28. +2 −1 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/lib/capistrano/configuration/execution.rb
  29. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/lib/capistrano/configuration/loading.rb
  30. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/lib/capistrano/configuration/namespaces.rb
  31. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/lib/capistrano/configuration/roles.rb
  32. +5 −4 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/lib/capistrano/configuration/servers.rb
  33. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/lib/capistrano/configuration/variables.rb
  34. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/lib/capistrano/errors.rb
  35. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/lib/capistrano/extensions.rb
  36. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/lib/capistrano/logger.rb
  37. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/lib/capistrano/processable.rb
  38. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/lib/capistrano/recipes/compat.rb
  39. +45 −22 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/lib/capistrano/recipes/deploy.rb
  40. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/lib/capistrano/recipes/deploy/dependencies.rb
  41. +7 −3 ...r/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/lib/capistrano/recipes/deploy/local_dependency.rb
  42. 0 .../plugins/{capistrano-2.4.3 → capistrano-2.5.0}/lib/capistrano/recipes/deploy/remote_dependency.rb
  43. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/lib/capistrano/recipes/deploy/scm.rb
  44. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/lib/capistrano/recipes/deploy/scm/accurev.rb
  45. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/lib/capistrano/recipes/deploy/scm/base.rb
  46. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/lib/capistrano/recipes/deploy/scm/bzr.rb
  47. +2 −1 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/lib/capistrano/recipes/deploy/scm/cvs.rb
  48. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/lib/capistrano/recipes/deploy/scm/darcs.rb
  49. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/lib/capistrano/recipes/deploy/scm/git.rb
  50. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/lib/capistrano/recipes/deploy/scm/mercurial.rb
  51. +1 −1 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/lib/capistrano/recipes/deploy/scm/none.rb
  52. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/lib/capistrano/recipes/deploy/scm/perforce.rb
  53. +1 −1 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/lib/capistrano/recipes/deploy/scm/subversion.rb
  54. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/lib/capistrano/recipes/deploy/strategy.rb
  55. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/lib/capistrano/recipes/deploy/strategy/base.rb
  56. 0 .../plugins/{capistrano-2.4.3 → capistrano-2.5.0}/lib/capistrano/recipes/deploy/strategy/checkout.rb
  57. +1 −1 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/lib/capistrano/recipes/deploy/strategy/copy.rb
  58. 0 ...or/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/lib/capistrano/recipes/deploy/strategy/export.rb
  59. 0 ...or/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/lib/capistrano/recipes/deploy/strategy/remote.rb
  60. +10 −1 ...gins/{capistrano-2.4.3 → capistrano-2.5.0}/lib/capistrano/recipes/deploy/strategy/remote_cache.rb
  61. 0 .../capistrano/recipes → capistrano-2.5.0/lib/capistrano/recipes/deploy}/templates/maintenance.rhtml
  62. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/lib/capistrano/recipes/standard.rb
  63. 0 .../capistrano/recipes/deploy → capistrano-2.5.0/lib/capistrano/recipes}/templates/maintenance.rhtml
  64. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/lib/capistrano/recipes/upgrade.rb
  65. +4 −0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/lib/capistrano/role.rb
  66. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/lib/capistrano/server_definition.rb
  67. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/lib/capistrano/shell.rb
  68. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/lib/capistrano/ssh.rb
  69. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/lib/capistrano/task_definition.rb
  70. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/lib/capistrano/transfer.rb
  71. +2 −2 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/lib/capistrano/version.rb
  72. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/setup.rb
  73. +1 −1 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/test/cli/execute_test.rb
  74. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/test/cli/help_test.rb
  75. +84 −0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/test/cli/options_test.rb
  76. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/test/cli/ui_test.rb
  77. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/test/cli_test.rb
  78. +38 −41 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/test/command_test.rb
  79. 0 ...or/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/test/configuration/actions/file_transfer_test.rb
  80. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/test/configuration/actions/inspect_test.rb
  81. +12 −16 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/test/configuration/actions/invocation_test.rb
  82. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/test/configuration/callbacks_test.rb
  83. +30 −9 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/test/configuration/connections_test.rb
  84. +16 −0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/test/configuration/execution_test.rb
  85. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/test/configuration/loading_test.rb
  86. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/test/configuration/namespace_dsl_test.rb
  87. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/test/configuration/roles_test.rb
  88. +15 −0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/test/configuration/servers_test.rb
  89. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/test/configuration/variables_test.rb
  90. +8 −1 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/test/configuration_test.rb
  91. +15 −12 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/test/deploy/local_dependency_test.rb
  92. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/test/deploy/remote_dependency_test.rb
  93. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/test/deploy/scm/accurev_test.rb
  94. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/test/deploy/scm/base_test.rb
  95. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/test/deploy/scm/git_test.rb
  96. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/test/deploy/scm/mercurial_test.rb
  97. +35 −0 vendor/plugins/capistrano-2.5.0/test/deploy/scm/none_test.rb
  98. +13 −0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/test/deploy/strategy/copy_test.rb
  99. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/test/extensions_test.rb
  100. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/test/fixtures/cli_integration.rb
  101. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/test/fixtures/config.rb
  102. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/test/fixtures/custom.rb
  103. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/test/logger_test.rb
  104. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/test/role_test.rb
  105. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/test/server_definition_test.rb
  106. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/test/shell_test.rb
  107. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/test/ssh_test.rb
  108. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/test/task_definition_test.rb
  109. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/test/transfer_test.rb
  110. 0 vendor/plugins/{capistrano-2.4.3 → capistrano-2.5.0}/test/utils.rb
View
@@ -1,6 +1,8 @@
SVN
+* Update Capistrano to 2.5.0
+
* Update to Rails 2.1.1
* Allow to clone a project. Stages and configuration is cloned for now. Closes #85
@@ -21,7 +21,7 @@
<p>
<b>Timezone</b><br />
- <%= time_zone_select 'user', :time_zone, TimeZone.all, {},{:style => "width:330px;"} %>
+ <%= time_zone_select 'user', :time_zone, ActiveSupport::TimeZone.all, {},{:style => "width:330px;"} %>
</p>
<% if logged_in? && current_user.admin? -%>
@@ -734,8 +734,8 @@ def test_list_tasks
deployer = Webistrano::Deployer.new(d)
assert_not_nil deployer.list_tasks
- assert_equal 23, deployer.list_tasks.size
- assert_equal 21, @stage.list_tasks.size # filter shell and invoke
+ assert_equal 25, deployer.list_tasks.size, deployer.list_tasks.map(&:fully_qualified_name).sort.inspect
+ assert_equal 23, @stage.list_tasks.size # filter shell and invoke
deployer.list_tasks.each{|t| assert t.is_a?(Capistrano::TaskDefinition) }
# add a stage recipe
@@ -749,8 +749,8 @@ def test_list_tasks
recipe = create_new_recipe(:name => 'A new recipe', :body => recipe_body)
@stage.recipes << recipe
- assert_equal 24, deployer.list_tasks.size
- assert_equal 22, @stage.list_tasks.size # filter shell and invoke
+ assert_equal 26, deployer.list_tasks.size
+ assert_equal 24, @stage.list_tasks.size # filter shell and invoke
assert_equal 1, deployer.list_tasks.delete_if{|t| t.fully_qualified_name != 'foo:bar'}.size
assert_equal 1, @stage.list_tasks.delete_if{|t| t[:name] != 'foo:bar'}.size
end
@@ -1,155 +0,0 @@
-require 'capistrano/errors'
-require 'capistrano/processable'
-
-module Capistrano
-
- # This class encapsulates a single command to be executed on a set of remote
- # machines, in parallel.
- class Command
- include Processable
-
- attr_reader :command, :sessions, :options
-
- def self.process(command, sessions, options={}, &block)
- new(command, sessions, options, &block).process!
- end
-
- # Instantiates a new command object. The +command+ must be a string
- # containing the command to execute. +sessions+ is an array of Net::SSH
- # session instances, and +options+ must be a hash containing any of the
- # following keys:
- #
- # * +logger+: (optional), a Capistrano::Logger instance
- # * +data+: (optional), a string to be sent to the command via it's stdin
- # * +env+: (optional), a string or hash to be interpreted as environment
- # variables that should be defined for this command invocation.
- def initialize(command, sessions, options={}, &block)
- @command = command.strip.gsub(/\r?\n/, "\\\n")
- @sessions = sessions
- @options = options
- @callback = block
- @channels = open_channels
- end
-
- # Processes the command in parallel on all specified hosts. If the command
- # fails (non-zero return code) on any of the hosts, this will raise a
- # Capistrano::CommandError.
- def process!
- loop do
- break unless process_iteration { @channels.any? { |ch| !ch[:closed] } }
- end
-
- logger.trace "command finished" if logger
-
- if (failed = @channels.select { |ch| ch[:status] != 0 }).any?
- hosts = failed.map { |ch| ch[:server] }
- error = CommandError.new("command #{command.inspect} failed on #{hosts.join(',')}")
- error.hosts = hosts
- raise error
- end
-
- self
- end
-
- # Force the command to stop processing, by closing all open channels
- # associated with this command.
- def stop!
- @channels.each do |ch|
- ch.close unless ch[:closed]
- end
- end
-
- private
-
- def logger
- options[:logger]
- end
-
- def open_channels
- sessions.map do |session|
- session.open_channel do |channel|
- server = session.xserver
-
- channel[:server] = server
- channel[:host] = server.host
- channel[:options] = options
-
- request_pty_if_necessary(channel) do |ch, success|
- if success
- logger.trace "executing command", ch[:server] if logger
- cmd = replace_placeholders(command, ch)
-
- if options[:shell] == false
- shell = nil
- else
- shell = "#{options[:shell] || "sh"} -c"
- cmd = cmd.gsub(/[$\\`"]/) { |m| "\\#{m}" }
- cmd = "\"#{cmd}\""
- end
-
- command_line = [environment, shell, cmd].compact.join(" ")
-
- ch.exec(command_line)
- ch.send_data(options[:data]) if options[:data]
- else
- # just log it, don't actually raise an exception, since the
- # process method will see that the status is not zero and will
- # raise an exception then.
- logger.important "could not open channel", ch[:server] if logger
- ch.close
- end
- end
-
- channel.on_data do |ch, data|
- @callback[ch, :out, data] if @callback
- end
-
- channel.on_extended_data do |ch, type, data|
- @callback[ch, :err, data] if @callback
- end
-
- channel.on_request("exit-status") do |ch, data|
- ch[:status] = data.read_long
- end
-
- channel.on_close do |ch|
- ch[:closed] = true
- end
- end
- end
- end
-
- def request_pty_if_necessary(channel)
- if options[:pty]
- channel.request_pty do |ch, success|
- yield ch, success
- end
- else
- yield channel, true
- end
- end
-
- def replace_placeholders(command, channel)
- command.gsub(/\$CAPISTRANO:HOST\$/, channel[:host])
- end
-
- # prepare a space-separated sequence of variables assignments
- # intended to be prepended to a command, so the shell sets
- # the environment before running the command.
- # i.e.: options[:env] = {'PATH' => '/opt/ruby/bin:$PATH',
- # 'TEST' => '( "quoted" )'}
- # environment returns:
- # "env TEST=(\ \"quoted\"\ ) PATH=/opt/ruby/bin:$PATH"
- def environment
- return if options[:env].nil? || options[:env].empty?
- @environment ||= if String === options[:env]
- "env #{options[:env]}"
- else
- options[:env].inject("env") do |string, (name, value)|
- value = value.to_s.gsub(/[ "]/) { |m| "\\#{m}" }
- string << " #{name}=#{value}"
- end
- end
- end
- end
-end
@@ -1,3 +1,42 @@
+== 2.5.0 / August 28, 2008
+
+* Allow :gateway to be set to an array, in which case a chain of tunnels is created [Kerry Buckley]
+
+* Allow HOSTS spec to override even non-existent roles [Mike Bailey]
+
+* Sort releases via "ls -xt" instead of "ls -x" to allow for custom release names [Yan Pritzker]
+
+* Convert arguments to -s and -S into integers, booleans, etc. based on whether the arguments appear to be those types [Jamis Buck]
+
+* Add descriptions of -n and -d to the verbose help text [Jamis Buck]
+
+* Make rollbacks work with processes that need the current directory to be valid in order to restart properly (e.g. mongrel_rails) [Jamis Buck]
+
+* Rename deploy:rollback_code to deploy:rollback:code [Jamis Buck]
+
+* Added parallel() helper for executing multiple different commands in parallel [Jamis Buck]
+
+* Make sure a task only uses the last on_rollback block, once, on rollback [Jamis Buck]
+
+* Add :shared_children variable to customize which subdirectories are created by deploy:setup [Jonathan Share]
+
+* Allow filename globbing in copy_exclude setting for the copy strategy [Jonathan Share]
+
+* Allow remote_cache strategy to use copy_exclude settings (requires rsync) [Lewis Mackenzie]
+
+* Make None SCM module work in Windows [Carlos Kozuszko]
+
+* Recognize mingw as a Windows platform [Carlos Kozuszko]
+
+* Fixed failing tests in Windows [Carlos Kozuszko]
+
+* Made :scm_auth_cache control whether password option is emitted in subversion module [Brendan Schwartz]
+
+* Fixed timestamp bug in CVS module [Jørgen Fjeld]
+
+* Added -n/--dry-run switch, to display but not execute remote tasks [Paul Gross]
+
+
== 2.4.3 / June 28, 2008
* Fix gem dependencies so gem actually understands them [Jamis Buck]
File renamed without changes.
File renamed without changes.
Oops, something went wrong.

0 comments on commit ccbcff0

Please sign in to comment.