mirror of
https://github.com/capistrano/capistrano
synced 2023-03-27 23:21:18 -04:00
Replace literal tabs with two spaces
Most versions of `sed` don't accept `\t`, instead enter a literal tab with Ctrl+v, Tab. git ls-files | xargs sed -i '' -e 's/[\t]/ /g'
This commit is contained in:
parent
4acea20beb
commit
16c5d3b71c
6 changed files with 45 additions and 45 deletions
14
CHANGELOG
14
CHANGELOG
|
@ -227,26 +227,26 @@ Git-version requirement for the new implementation is now >= 1.5.6, from
|
||||||
previously un-documented. (1.5.6 is new-enough that I think this is
|
previously un-documented. (1.5.6 is new-enough that I think this is
|
||||||
acceptable)
|
acceptable)
|
||||||
|
|
||||||
* Upgrade Net::SSH-gateway dependency to 1.1 (fixes a thread-deadlocking bug on MRI 1.9)
|
* Upgrade Net::SSH-gateway dependency to 1.1 (fixes a thread-deadlocking bug on MRI 1.9)
|
||||||
* Respect "dry-run" on transfer methods (Florian Frank)
|
* Respect "dry-run" on transfer methods (Florian Frank)
|
||||||
* Add support for multiple gateways: (Ryan Duryea)
|
* Add support for multiple gateways: (Ryan Duryea)
|
||||||
set :gateway, {
|
set :gateway, {
|
||||||
'gate1.example.com' => 'server1.example.com',
|
'gate1.example.com' => 'server1.example.com',
|
||||||
[ 'gate2.example.com', 'gate3.example.com' ] => [ 'server5.example.com', 'server6.example.com' ]
|
[ 'gate2.example.com', 'gate3.example.com' ] => [ 'server5.example.com', 'server6.example.com' ]
|
||||||
}
|
}
|
||||||
* Properly support nested Git submodules, moves Git requirement to >= 1.5.6 [if you rely upon submodules] (Ken Miller)
|
* Properly support nested Git submodules, moves Git requirement to >= 1.5.6 [if you rely upon submodules] (Ken Miller)
|
||||||
* Fetch tags into the remote cache, allows deploying a tag when using Git, with the remote_cache strategy (Florian Frank)
|
* Fetch tags into the remote cache, allows deploying a tag when using Git, with the remote_cache strategy (Florian Frank)
|
||||||
* Various fixes to path handling bugs in the copt strategy. (Philippe Rathé)
|
* Various fixes to path handling bugs in the copt strategy. (Philippe Rathé)
|
||||||
|
|
||||||
## 2.5.21 / April 6 2011
|
## 2.5.21 / April 6 2011
|
||||||
|
|
||||||
* Fixed to follow best-practice guidelines from Bundler (Ben Langfeld)
|
* Fixed to follow best-practice guidelines from Bundler (Ben Langfeld)
|
||||||
* No longer force a gemset for Capistrano development. (Ben Langfeld)
|
* No longer force a gemset for Capistrano development. (Ben Langfeld)
|
||||||
|
|
||||||
## 2.5.20 / March 16 2011
|
## 2.5.20 / March 16 2011
|
||||||
|
|
||||||
* `deploy:migrations` will now always operate on the latest_release, not
|
* `deploy:migrations` will now always operate on the latest_release, not
|
||||||
current_release (Mike Vincent)
|
current_release (Mike Vincent)
|
||||||
* Adds a check for the presence of `rsync` when using the copy strategy with `rsync`. (Chris Griego)
|
* Adds a check for the presence of `rsync` when using the copy strategy with `rsync`. (Chris Griego)
|
||||||
* Do not try to look up the `:release_path` on servers which are defined `:no_release` (Chris Griego)
|
* Do not try to look up the `:release_path` on servers which are defined `:no_release` (Chris Griego)
|
||||||
* Tiny patch to the `CVS` SCM code to be Ruby 1.9 compatible (Martin Carpenter)
|
* Tiny patch to the `CVS` SCM code to be Ruby 1.9 compatible (Martin Carpenter)
|
||||||
|
|
|
@ -39,7 +39,7 @@ assumptions behind these opinions are:
|
||||||
|
|
||||||
* You are using SSH to access the remote servers.
|
* You are using SSH to access the remote servers.
|
||||||
* You either have the same password to all target machines, or you have public
|
* You either have the same password to all target machines, or you have public
|
||||||
keys in place to allow passwordless access to them.
|
keys in place to allow passwordless access to them.
|
||||||
|
|
||||||
Do not expect these assumptions to change.
|
Do not expect these assumptions to change.
|
||||||
|
|
||||||
|
|
|
@ -6,76 +6,76 @@ Capistrano is a utility for automating the execution of commands across multiple
|
||||||
|
|
||||||
The command-line interface to Capistrano is via the `cap' command.
|
The command-line interface to Capistrano is via the `cap' command.
|
||||||
|
|
||||||
cap [ option ] ... action ...
|
cap [ option ] ... action ...
|
||||||
|
|
||||||
The following options are understood:
|
The following options are understood:
|
||||||
|
|
||||||
<%= color '-d, --debug', :bold %>
|
<%= color '-d, --debug', :bold %>
|
||||||
Causes Capistrano to pause and prompt before executing any remote command, giving the user the option to either execute the command, skip the command, or abort execution entirely. This makes it a great way to troubleshoot tasks, or test custom tasks, by executing commands one at a time and checking the server to make sure they worked as expected before moving on to the next command. (Compare this to the --dry-run command.)
|
Causes Capistrano to pause and prompt before executing any remote command, giving the user the option to either execute the command, skip the command, or abort execution entirely. This makes it a great way to troubleshoot tasks, or test custom tasks, by executing commands one at a time and checking the server to make sure they worked as expected before moving on to the next command. (Compare this to the --dry-run command.)
|
||||||
|
|
||||||
<%= color '-e, --explain TASK', :bold %>
|
<%= color '-e, --explain TASK', :bold %>
|
||||||
Displays the extended description of the given task. Not all tasks will have an extended description, but for those that do, this can provide a wealth of additional usage information, such as describing environment variables or settings that can affect the execution of the task.
|
Displays the extended description of the given task. Not all tasks will have an extended description, but for those that do, this can provide a wealth of additional usage information, such as describing environment variables or settings that can affect the execution of the task.
|
||||||
|
|
||||||
<%= color '-F, --default-config', :bold %>
|
<%= color '-F, --default-config', :bold %>
|
||||||
By default, cap will search for a config file named `Capfile' or `capfile' in the current directory, or in any parent directory, and will automatically load it. However, if you specify the -f flag (see below), cap will use that file instead of the default config. If you want to use both the default config, and files loaded via -f, you can specify -F to force cap to search for and load the default config, even if additional files were specified via -f.
|
By default, cap will search for a config file named `Capfile' or `capfile' in the current directory, or in any parent directory, and will automatically load it. However, if you specify the -f flag (see below), cap will use that file instead of the default config. If you want to use both the default config, and files loaded via -f, you can specify -F to force cap to search for and load the default config, even if additional files were specified via -f.
|
||||||
|
|
||||||
<%= color '-f, --file FILE', :bold %>
|
<%= color '-f, --file FILE', :bold %>
|
||||||
Causes the named file to be loaded. Capistrano will search both its own recipe directory, as well as the current directory, looking for the named file. An ".rb" extension is optional. The -f option may be given any number of times, but if it is given, it will take the place of the normal `Capfile' or `capfile' detection. Use -F if you want the default capfile to be loaded when you use -f.
|
Causes the named file to be loaded. Capistrano will search both its own recipe directory, as well as the current directory, looking for the named file. An ".rb" extension is optional. The -f option may be given any number of times, but if it is given, it will take the place of the normal `Capfile' or `capfile' detection. Use -F if you want the default capfile to be loaded when you use -f.
|
||||||
|
|
||||||
<%= color '-H, --long-help', :bold %>
|
<%= color '-H, --long-help', :bold %>
|
||||||
Displays this document and exits.
|
Displays this document and exits.
|
||||||
|
|
||||||
<%= color '-h, --help', :bold %>
|
<%= color '-h, --help', :bold %>
|
||||||
Shows a brief summary of these options and exits.
|
Shows a brief summary of these options and exits.
|
||||||
|
|
||||||
<%= color '-l, --logger [STDERR|STDOUT|file]', :bold %>
|
<%= color '-l, --logger [STDERR|STDOUT|file]', :bold %>
|
||||||
Change the file used to print the output. It offers three options: standard error(stderr), standard output and file. Options are not case sensitive. By default Capistrano uses stderr.
|
Change the file used to print the output. It offers three options: standard error(stderr), standard output and file. Options are not case sensitive. By default Capistrano uses stderr.
|
||||||
|
|
||||||
<%= color '-n, --dry-run', :bold %>
|
<%= color '-n, --dry-run', :bold %>
|
||||||
Causes Capistrano to simply display each remote command, without executing it. In this sense it is similar to --debug, but without the prompt. Note that commands executed locally are still run--only remote commands are skipped.
|
Causes Capistrano to simply display each remote command, without executing it. In this sense it is similar to --debug, but without the prompt. Note that commands executed locally are still run--only remote commands are skipped.
|
||||||
|
|
||||||
<%= color '-p, --password', :bold %>
|
<%= color '-p, --password', :bold %>
|
||||||
Normally, cap will prompt for the password on-demand, the first time it is needed. This can make it hard to walk away from Capistrano, since you might not know if it will prompt for a password down the road. In such cases, you can use the -p option to force cap to prompt for the password immediately.
|
Normally, cap will prompt for the password on-demand, the first time it is needed. This can make it hard to walk away from Capistrano, since you might not know if it will prompt for a password down the road. In such cases, you can use the -p option to force cap to prompt for the password immediately.
|
||||||
|
|
||||||
<%= color '-q, --quiet', :bold %>
|
<%= color '-q, --quiet', :bold %>
|
||||||
Display only critical error messages. All other output is suppressed.
|
Display only critical error messages. All other output is suppressed.
|
||||||
|
|
||||||
<%= color '-S, --set-before NAME=VALUE', :bold %>
|
<%= color '-S, --set-before NAME=VALUE', :bold %>
|
||||||
Sets the given variable to the given value, before loading any recipe files. This is useful if you have a recipe file that depends on a certain variable being set, at the time it is loaded.
|
Sets the given variable to the given value, before loading any recipe files. This is useful if you have a recipe file that depends on a certain variable being set, at the time it is loaded.
|
||||||
|
|
||||||
<%= color '-s, --set NAME=VALUE', :bold %>
|
<%= color '-s, --set NAME=VALUE', :bold %>
|
||||||
Sets the given variable to the given value, after loading all recipe files. This is useful when you want to override the value of a variable which is used in a task. Note that this will set the variables too late for them to affect conditions that are executed as the recipes are loaded.
|
Sets the given variable to the given value, after loading all recipe files. This is useful when you want to override the value of a variable which is used in a task. Note that this will set the variables too late for them to affect conditions that are executed as the recipes are loaded.
|
||||||
|
|
||||||
<%= color '-T, --tasks PATTERN', :bold %>
|
<%= color '-T, --tasks PATTERN', :bold %>
|
||||||
Displays the list of all tasks (matching optional PATTERN) in all loaded recipe files. If a task has no description, or if the description starts with the [internal] tag, the task will not be listed unless you also specify -v.
|
Displays the list of all tasks (matching optional PATTERN) in all loaded recipe files. If a task has no description, or if the description starts with the [internal] tag, the task will not be listed unless you also specify -v.
|
||||||
|
|
||||||
<%= color '-t, --tool', :bold %>
|
<%= color '-t, --tool', :bold %>
|
||||||
Abbreviates the output of -T for integration with other tools. Without -t, -T will list tasks with their summaries, and may include additional instructive text at the bottom. When integrating with other tools (e.g., bash auto-expansion and the like) that additional text can get in the way. This switch makes it easier for those tools to parse the list of tasks. (The -t switch has no effect if the -T switch is not specified.)
|
Abbreviates the output of -T for integration with other tools. Without -t, -T will list tasks with their summaries, and may include additional instructive text at the bottom. When integrating with other tools (e.g., bash auto-expansion and the like) that additional text can get in the way. This switch makes it easier for those tools to parse the list of tasks. (The -t switch has no effect if the -T switch is not specified.)
|
||||||
|
|
||||||
<%= color '-V, --version', :bold %>
|
<%= color '-V, --version', :bold %>
|
||||||
Shows the current Capistrano version number and exits.
|
Shows the current Capistrano version number and exits.
|
||||||
|
|
||||||
<%= color '-v, --verbose', :bold %>
|
<%= color '-v, --verbose', :bold %>
|
||||||
Increase the verbosity. You can specify this option up to three times to further increase verbosity. By default, cap will use maximum verbosity, but if you specify an explicit verbosity, that will be used instead. See also -q.
|
Increase the verbosity. You can specify this option up to three times to further increase verbosity. By default, cap will use maximum verbosity, but if you specify an explicit verbosity, that will be used instead. See also -q.
|
||||||
|
|
||||||
<%= color '-X, --skip-system-config', :bold %>
|
<%= color '-X, --skip-system-config', :bold %>
|
||||||
By default, cap will look for and (if it exists) load the global system configuration file located in /etc/capistrano.conf. If you don't want cap to load that file, give this option.
|
By default, cap will look for and (if it exists) load the global system configuration file located in /etc/capistrano.conf. If you don't want cap to load that file, give this option.
|
||||||
|
|
||||||
<%= color '-x, --skip-user-config', :bold %>
|
<%= color '-x, --skip-user-config', :bold %>
|
||||||
By default, cap will look for and (if it exists) load the user-specific configuration file located in $HOME/.caprc. If you don't want cap to load that file, give this option.
|
By default, cap will look for and (if it exists) load the user-specific configuration file located in $HOME/.caprc. If you don't want cap to load that file, give this option.
|
||||||
|
|
||||||
-----------------------------
|
-----------------------------
|
||||||
<%= color('Environment Variables', :bold) %>
|
<%= color('Environment Variables', :bold) %>
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
||||||
<%= color 'HOSTS', :bold %>
|
<%= color 'HOSTS', :bold %>
|
||||||
Execute the tasks against this comma-separated list of hosts. Effectively, this makes the host(s) part of every roles.
|
Execute the tasks against this comma-separated list of hosts. Effectively, this makes the host(s) part of every roles.
|
||||||
|
|
||||||
<%= color 'HOSTFILTER', :bold %>
|
<%= color 'HOSTFILTER', :bold %>
|
||||||
Execute tasks against this comma-separated list of host, but only if the host has the proper role for the task.
|
Execute tasks against this comma-separated list of host, but only if the host has the proper role for the task.
|
||||||
|
|
||||||
<%= color 'HOSTROLEFILTER', :bold %>
|
<%= color 'HOSTROLEFILTER', :bold %>
|
||||||
Execute tasks against the hosts in this comma-separated list of roles, but only if the host has the proper role for the task.
|
Execute tasks against the hosts in this comma-separated list of roles, but only if the host has the proper role for the task.
|
||||||
|
|
||||||
<%= color 'ROLES', :bold %>
|
<%= color 'ROLES', :bold %>
|
||||||
Execute tasks against this comma-separated list of roles. Hosts which do not have the right roles will be skipped.
|
Execute tasks against this comma-separated list of roles. Hosts which do not have the right roles will be skipped.
|
||||||
|
|
|
@ -69,13 +69,13 @@ module Capistrano
|
||||||
def handle_data(state, stream, text)
|
def handle_data(state, stream, text)
|
||||||
case text
|
case text
|
||||||
when /\(P4PASSWD\) invalid or unset\./i
|
when /\(P4PASSWD\) invalid or unset\./i
|
||||||
raise Capistrano::Error, "scm_password (or p4passwd) is incorrect or unset"
|
raise Capistrano::Error, "scm_password (or p4passwd) is incorrect or unset"
|
||||||
when /Can.t create a new user.*/i
|
when /Can.t create a new user.*/i
|
||||||
raise Capistrano::Error, "scm_username (or p4user) is incorrect or unset"
|
raise Capistrano::Error, "scm_username (or p4user) is incorrect or unset"
|
||||||
when /Perforce client error\:/i
|
when /Perforce client error\:/i
|
||||||
raise Capistrano::Error, "p4port is incorrect or unset"
|
raise Capistrano::Error, "p4port is incorrect or unset"
|
||||||
when /Client \'[\w\-\_\.]+\' unknown.*/i
|
when /Client \'[\w\-\_\.]+\' unknown.*/i
|
||||||
raise Capistrano::Error, "p4client is incorrect or unset"
|
raise Capistrano::Error, "p4client is incorrect or unset"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,7 @@ module Capistrano
|
||||||
# etc. are handled here.
|
# etc. are handled here.
|
||||||
def handle_data(state, stream, text)
|
def handle_data(state, stream, text)
|
||||||
host = state[:channel][:host]
|
host = state[:channel][:host]
|
||||||
logger.info "[#{host} :: #{stream}] #{text}"
|
logger.info "[#{host} :: #{stream}] #{text}"
|
||||||
case text
|
case text
|
||||||
when /\bpassword.*:/i
|
when /\bpassword.*:/i
|
||||||
# subversion is prompting for a password
|
# subversion is prompting for a password
|
||||||
|
|
|
@ -5,11 +5,11 @@ require 'capistrano/configuration/servers'
|
||||||
class ConfigurationServersTest < Test::Unit::TestCase
|
class ConfigurationServersTest < Test::Unit::TestCase
|
||||||
class MockConfig
|
class MockConfig
|
||||||
attr_reader :roles
|
attr_reader :roles
|
||||||
attr_accessor :preserve_roles
|
attr_accessor :preserve_roles
|
||||||
|
|
||||||
def initialize
|
def initialize
|
||||||
@roles = {}
|
@roles = {}
|
||||||
@preserve_roles = false
|
@preserve_roles = false
|
||||||
end
|
end
|
||||||
|
|
||||||
include Capistrano::Configuration::Servers
|
include Capistrano::Configuration::Servers
|
||||||
|
@ -66,31 +66,31 @@ class ConfigurationServersTest < Test::Unit::TestCase
|
||||||
|
|
||||||
def test_task_with_roles_as_environment_variable_and_preserve_roles_should_apply_only_to_existant_task_role
|
def test_task_with_roles_as_environment_variable_and_preserve_roles_should_apply_only_to_existant_task_role
|
||||||
ENV['ROLES'] = "app,file"
|
ENV['ROLES'] = "app,file"
|
||||||
@config.preserve_roles = true
|
@config.preserve_roles = true
|
||||||
task = new_task(:testing,@config, :roles => :app)
|
task = new_task(:testing,@config, :roles => :app)
|
||||||
assert_equal %w(app1 app2 app3).sort, @config.find_servers_for_task(task).map { |s| s.host }.sort
|
assert_equal %w(app1 app2 app3).sort, @config.find_servers_for_task(task).map { |s| s.host }.sort
|
||||||
ensure
|
ensure
|
||||||
ENV.delete('ROLES')
|
ENV.delete('ROLES')
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_task_with_roles_as_environment_variable_and_preserve_roles_should_apply_only_to_existant_task_roles
|
def test_task_with_roles_as_environment_variable_and_preserve_roles_should_apply_only_to_existant_task_roles
|
||||||
ENV['ROLES'] = "app,file,web"
|
ENV['ROLES'] = "app,file,web"
|
||||||
@config.preserve_roles = true
|
@config.preserve_roles = true
|
||||||
task = new_task(:testing,@config, :roles => [ :app,:file ])
|
task = new_task(:testing,@config, :roles => [ :app,:file ])
|
||||||
assert_equal %w(app1 app2 app3 file).sort, @config.find_servers_for_task(task).map { |s| s.host }.sort
|
assert_equal %w(app1 app2 app3 file).sort, @config.find_servers_for_task(task).map { |s| s.host }.sort
|
||||||
ensure
|
ensure
|
||||||
ENV.delete('ROLES')
|
ENV.delete('ROLES')
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_task_with_roles_as_environment_variable_and_preserve_roles_should_not_apply_if_not_exists_those_task_roles
|
def test_task_with_roles_as_environment_variable_and_preserve_roles_should_not_apply_if_not_exists_those_task_roles
|
||||||
ENV['ROLES'] = "file,web"
|
ENV['ROLES'] = "file,web"
|
||||||
@config.preserve_roles = true
|
@config.preserve_roles = true
|
||||||
task = new_task(:testing,@config, :roles => [ :app ])
|
task = new_task(:testing,@config, :roles => [ :app ])
|
||||||
assert_equal [], @config.find_servers_for_task(task).map { |s| s.host }.sort
|
assert_equal [], @config.find_servers_for_task(task).map { |s| s.host }.sort
|
||||||
ensure
|
ensure
|
||||||
ENV.delete('ROLES')
|
ENV.delete('ROLES')
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_task_with_hosts_as_environment_variable_should_apply_only_to_those_hosts
|
def test_task_with_hosts_as_environment_variable_should_apply_only_to_those_hosts
|
||||||
ENV['HOSTS'] = "foo,bar"
|
ENV['HOSTS'] = "foo,bar"
|
||||||
task = new_task(:testing)
|
task = new_task(:testing)
|
||||||
|
|
Loading…
Reference in a new issue