Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

part 2, rename switchtower -> capistrano

git-svn-id: http://svn.rubyonrails.org/rails/tools/capistrano@3786 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit 6efd009569184e1a43f07939c6e0042f80b59014 1 parent 88a09bb
@jamis jamis authored
Showing with 59 additions and 57 deletions.
  1. +2 −0  CHANGELOG
  2. +1 −1  MIT-LICENSE
  3. +12 −12 README
  4. +4 −4 Rakefile
  5. +2 −2 bin/{switchtower → cap}
  6. +8 −8 switchtower.gemspec → capistrano.gemspec
  7. +1 −0  lib/capistrano.rb
  8. 0  lib/{switchtower → capistrano}/actor.rb
  9. 0  lib/{switchtower → capistrano}/cli.rb
  10. 0  lib/{switchtower → capistrano}/command.rb
  11. 0  lib/{switchtower → capistrano}/configuration.rb
  12. 0  lib/{switchtower → capistrano}/extensions.rb
  13. 0  lib/{switchtower → capistrano}/gateway.rb
  14. 0  lib/{switchtower → capistrano}/generators/rails/deployment/deployment_generator.rb
  15. 0  lib/{switchtower → capistrano}/generators/rails/deployment/templates/deploy.rb
  16. 0  lib/{switchtower → capistrano}/generators/rails/deployment/templates/switchtower.rake
  17. 0  lib/{switchtower → capistrano}/generators/rails/loader.rb
  18. 0  lib/{switchtower → capistrano}/logger.rb
  19. 0  lib/{switchtower → capistrano}/recipes/standard.rb
  20. 0  lib/{switchtower → capistrano}/recipes/templates/maintenance.rhtml
  21. 0  lib/{switchtower → capistrano}/scm/base.rb
  22. 0  lib/{switchtower → capistrano}/scm/baz.rb
  23. 0  lib/{switchtower → capistrano}/scm/bzr.rb
  24. 0  lib/{switchtower → capistrano}/scm/cvs.rb
  25. 0  lib/{switchtower → capistrano}/scm/darcs.rb
  26. 0  lib/{switchtower → capistrano}/scm/perforce.rb
  27. 0  lib/{switchtower → capistrano}/scm/subversion.rb
  28. 0  lib/{switchtower → capistrano}/ssh.rb
  29. 0  lib/{switchtower → capistrano}/transfer.rb
  30. 0  lib/{switchtower → capistrano}/utils.rb
  31. 0  lib/{switchtower → capistrano}/version.rb
  32. +0 −1  lib/switchtower.rb
  33. +8 −8 test/actor_test.rb
  34. +4 −4 test/command_test.rb
  35. +4 −4 test/configuration_test.rb
  36. +2 −2 test/fixtures/custom.rb
  37. +2 −2 test/scm/cvs_test.rb
  38. +3 −3 test/scm/subversion_test.rb
  39. +6 −6 test/ssh_test.rb
View
2  CHANGELOG
@@ -1,5 +1,7 @@
*1.0.2* *SVN*
+* Rename to capistrano
+
* Make the generated switchtower.rake file use rake namespaces, and include all default tasks
* Look for config/deploy.rb and stasks file by default
View
2  MIT-LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2005 Jamis Buck
+Copyright (c) 2005,2006 Jamis Buck
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
View
24 README
@@ -1,35 +1,35 @@
-= SwitchTower
+= Capistrano
-SwitchTower 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.
+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.
-SwitchTower was originally designed to simplify and automate deployment of web applications to distributed environments, and so it comes with many tasks predefined for that ("update_code" and "deploy", for instance).
+Capistrano was originally designed to simplify and automate deployment of web applications to distributed environments, and so it comes with many tasks predefined for that ("update_code" and "deploy", for instance).
== Dependencies
-SwitchTower depends upon the Net::SSH library by Jamis Buck (http://net-ssh.rubyforge.org). Net::SSH itself depends on the Needle library (http://needle.rubyforge.org), also by Jamis Buck.
+Capistrano depends upon the Net::SSH library by Jamis Buck (http://net-ssh.rubyforge.org). Net::SSH itself depends on the Needle library (http://needle.rubyforge.org), also by Jamis Buck.
== Assumptions
-In keeping with Rails' "convention over configuration", SwitchTower makes several assumptions about how you will use it (most, if not all, of which may be explicitly overridden):
+In keeping with Rails' "convention over configuration", Capistrano makes several assumptions about how you will use it (most, if not all, of which may be explicitly overridden):
-* You are writing web applications and want to use SwitchTower to deploy them.
+* You are writing web applications and want to use Capistrano to deploy them.
* You are using Ruby on Rails (http://www.rubyonrails.com) to build your apps.
* You are using Subversion (http://subversion.tigris.org/) to manage your source code.
* You are running your apps using FastCGI, together with Rails' spinner/reaper utilities.
-As with the rest of Rails, if you can abide by these assumptions, you can use SwitchTower "out of the box". If any of these assumptions do not hold, you'll need to make some adjustments to your deployment recipe files.
+As with the rest of Rails, if you can abide by these assumptions, you can use Capistrano "out of the box". If any of these assumptions do not hold, you'll need to make some adjustments to your deployment recipe files.
== Usage
More documentation is always pending, but you'll want to see the user manual for detailed usage instructions. (The manual is online at http://manuals.rubyonrails.org/read/book/17).
-In general, you'll use SwitchTower as follows:
+In general, you'll use Capistrano as follows:
* Create a deployment recipe ("deploy.rb") for your application. You can use the sample recipe in examples/sample.rb as a starting point.
-* Use the +switchtower+ script to execute your recipe (see below).
+* Use the +cap+ script to execute your recipe (see below).
-Use the +switchtower+ script as follows:
+Use the +cap+ script as follows:
- switchtower -r deploy -a someaction -vvv
+ cap -vvv someaction
-The <tt>-r</tt> switch specifies the recipe to use, and the <tt>-a</tt> switch specifies which action you want to execute. You can the <tt>-v</tt> switch multiple times (as shown) to increase the verbosity of the output.
+By default, the script will look for a file called one of <tt>config/deploy</tt>, <tt>config/deploy.rb</tt>, <tt>capistrano</tt>, or <tt>capistrano.rb</tt>. You can the <tt>-v</tt> switch multiple times (as shown) to increase the verbosity of the output. The +someaction+ text indicates which action to execute.
View
8 Rakefile
@@ -5,11 +5,11 @@ require 'rake/packagetask'
require 'rake/gempackagetask'
require 'rake/contrib/rubyforgepublisher'
-require "./lib/switchtower/version"
+require "./lib/capistrano/version"
-PKG_NAME = "switchtower"
+PKG_NAME = "capistrano"
PKG_BUILD = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : ''
-PKG_VERSION = SwitchTower::Version::STRING + PKG_BUILD
+PKG_VERSION = Capistrano::Version::STRING + PKG_BUILD
PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
desc "Default task"
@@ -35,7 +35,7 @@ end
desc "Build the RDoc API documentation"
Rake::RDocTask.new do |rdoc|
rdoc.rdoc_dir = "doc"
- rdoc.title = "SwitchTower -- A framework for remote command execution"
+ rdoc.title = "Capistrano -- A framework for remote command execution"
rdoc.options << '--line-numbers --inline-source --main README'
rdoc.rdoc_files.include 'README'
rdoc.rdoc_files.include 'lib/**/*.rb'
View
4 bin/switchtower → bin/cap
@@ -6,6 +6,6 @@ rescue LoadError
# no rubygems to load, so we fail silently
end
-require 'switchtower/cli'
+require 'capistrano/cli'
-SwitchTower::CLI.execute!
+Capistrano::CLI.execute!
View
16 switchtower.gemspec → capistrano.gemspec
@@ -1,12 +1,12 @@
-require './lib/switchtower/version'
+require './lib/capistrano/version'
Gem::Specification.new do |s|
- s.name = 'switchtower'
+ s.name = 'capistrano'
s.version = PKG_VERSION
s.platform = Gem::Platform::RUBY
s.summary = <<-DESC.strip.gsub(/\n/, " ")
- SwitchTower is a framework and utility for executing commands in parallel
+ Capistrano is a framework and utility for executing commands in parallel
on multiple remote machines, via SSH. The primary goal is to simplify and
automate the deployment of web applications.
DESC
@@ -14,16 +14,16 @@ Gem::Specification.new do |s|
s.files = Dir.glob("{bin,lib,examples,test}/**/*")
s.files.concat %w(README MIT-LICENSE ChangeLog)
s.require_path = 'lib'
- s.autorequire = 'switchtower'
+ s.autorequire = 'capistrano'
s.bindir = "bin"
- s.executables << "switchtower"
+ s.executables << "cap"
- s.add_dependency 'net-ssh', ">= #{SwitchTower::Version::SSH_REQUIRED.join(".")}"
- s.add_dependency 'net-sftp', ">= #{SwitchTower::Version::SFTP_REQUIRED.join(".")}"
+ s.add_dependency 'net-ssh', ">= #{Capistrano::Version::SSH_REQUIRED.join(".")}"
+ s.add_dependency 'net-sftp', ">= #{Capistrano::Version::SFTP_REQUIRED.join(".")}"
s.author = "Jamis Buck"
s.email = "jamis@37signals.com"
- s.homepage = "http://www.rubyonrails.com"
+ s.homepage = "http://www.rubyonrails.org"
end
View
1  lib/capistrano.rb
@@ -0,0 +1 @@
+require 'capistrano/configuration'
View
0  lib/switchtower/actor.rb → lib/capistrano/actor.rb
File renamed without changes
View
0  lib/switchtower/cli.rb → lib/capistrano/cli.rb
File renamed without changes
View
0  lib/switchtower/command.rb → lib/capistrano/command.rb
File renamed without changes
View
0  lib/switchtower/configuration.rb → lib/capistrano/configuration.rb
File renamed without changes
View
0  lib/switchtower/extensions.rb → lib/capistrano/extensions.rb
File renamed without changes
View
0  lib/switchtower/gateway.rb → lib/capistrano/gateway.rb
File renamed without changes
View
0  ...nerators/rails/deployment/deployment_generator.rb → ...nerators/rails/deployment/deployment_generator.rb
File renamed without changes
View
0  ...r/generators/rails/deployment/templates/deploy.rb → ...o/generators/rails/deployment/templates/deploy.rb
File renamed without changes
View
0  ...ators/rails/deployment/templates/switchtower.rake → ...ators/rails/deployment/templates/switchtower.rake
File renamed without changes
View
0  lib/switchtower/generators/rails/loader.rb → lib/capistrano/generators/rails/loader.rb
File renamed without changes
View
0  lib/switchtower/logger.rb → lib/capistrano/logger.rb
File renamed without changes
View
0  lib/switchtower/recipes/standard.rb → lib/capistrano/recipes/standard.rb
File renamed without changes
View
0  lib/switchtower/recipes/templates/maintenance.rhtml → lib/capistrano/recipes/templates/maintenance.rhtml
File renamed without changes
View
0  lib/switchtower/scm/base.rb → lib/capistrano/scm/base.rb
File renamed without changes
View
0  lib/switchtower/scm/baz.rb → lib/capistrano/scm/baz.rb
File renamed without changes
View
0  lib/switchtower/scm/bzr.rb → lib/capistrano/scm/bzr.rb
File renamed without changes
View
0  lib/switchtower/scm/cvs.rb → lib/capistrano/scm/cvs.rb
File renamed without changes
View
0  lib/switchtower/scm/darcs.rb → lib/capistrano/scm/darcs.rb
File renamed without changes
View
0  lib/switchtower/scm/perforce.rb → lib/capistrano/scm/perforce.rb
File renamed without changes
View
0  lib/switchtower/scm/subversion.rb → lib/capistrano/scm/subversion.rb
File renamed without changes
View
0  lib/switchtower/ssh.rb → lib/capistrano/ssh.rb
File renamed without changes
View
0  lib/switchtower/transfer.rb → lib/capistrano/transfer.rb
File renamed without changes
View
0  lib/switchtower/utils.rb → lib/capistrano/utils.rb
File renamed without changes
View
0  lib/switchtower/version.rb → lib/capistrano/version.rb
File renamed without changes
View
1  lib/switchtower.rb
@@ -1 +0,0 @@
-require 'switchtower/configuration'
View
16 test/actor_test.rb
@@ -2,9 +2,9 @@
require 'stringio'
require 'test/unit'
-require 'switchtower/actor'
-require 'switchtower/logger'
-require 'switchtower/configuration'
+require 'capistrano/actor'
+require 'capistrano/logger'
+require 'capistrano/configuration'
class ActorTest < Test::Unit::TestCase
@@ -44,7 +44,7 @@ def process!
end
end
- class TestActor < SwitchTower::Actor
+ class TestActor < Capistrano::Actor
attr_reader :factory
self.connection_factory = TestingConnectionFactory
@@ -80,7 +80,7 @@ def roles
end
def logger
- @logger ||= SwitchTower::Logger.new(:output => StringIO.new)
+ @logger ||= Capistrano::Logger.new(:output => StringIO.new)
end
end
@@ -267,7 +267,7 @@ def test_task_after_hook
end
def test_uppercase_variables
- config = SwitchTower::Configuration.new(TestActor)
+ config = Capistrano::Configuration.new(TestActor)
config.set :HELLO, "world"
assert_equal "world", config.actor.instance_eval("HELLO")
config.set :HELLO, "test"
@@ -283,12 +283,12 @@ def test_connect_when_no_matching_servers
end
def test_custom_extension
- assert SwitchTower.plugin(:custom, CustomExtension)
+ assert Capistrano.plugin(:custom, CustomExtension)
@actor.define_task :foo, :roles => :db do
custom.do_something_extra(1, 2, 3)
end
assert_nothing_raised { @actor.foo }
assert TestingCommand.invoked?
- assert SwitchTower.remove_plugin(:custom)
+ assert Capistrano.remove_plugin(:custom)
end
end
View
8 test/command_test.rb
@@ -2,7 +2,7 @@
require 'stringio'
require 'test/unit'
-require 'switchtower/command'
+require 'capistrano/command'
class CommandTest < Test::Unit::TestCase
class MockSession
@@ -24,19 +24,19 @@ def setup
end
def test_command_executes_on_all_servers
- command = SwitchTower::Command.new(%w(server1 server2 server3),
+ command = Capistrano::Command.new(%w(server1 server2 server3),
"hello", nil, {}, @actor)
assert_equal %w(server1 server2 server3), @actor.sessions.keys.sort
end
def test_command_with_newlines
- command = SwitchTower::Command.new(%w(server1), "hello\nworld", nil, {},
+ command = Capistrano::Command.new(%w(server1), "hello\nworld", nil, {},
@actor)
assert_equal "hello\\\nworld", command.command
end
def test_command_with_windows_newlines
- command = SwitchTower::Command.new(%w(server1), "hello\r\nworld", nil, {},
+ command = Capistrano::Command.new(%w(server1), "hello\r\nworld", nil, {},
@actor)
assert_equal "hello\\\nworld", command.command
end
View
8 test/configuration_test.rb
@@ -1,7 +1,7 @@
$:.unshift File.dirname(__FILE__) + "/../lib"
require 'test/unit'
-require 'switchtower/configuration'
+require 'capistrano/configuration'
require 'flexmock'
class ConfigurationTest < Test::Unit::TestCase
@@ -25,7 +25,7 @@ def initialize(config)
end
def setup
- @config = SwitchTower::Configuration.new(MockActor)
+ @config = Capistrano::Configuration.new(MockActor)
@config.set :scm, MockSCM
end
@@ -210,12 +210,12 @@ def test_task_description
def test_set_scm_to_darcs
@config.set :scm, :darcs
- assert_equal "SwitchTower::SCM::Darcs", @config.source.class.name
+ assert_equal "Capistrano::SCM::Darcs", @config.source.class.name
end
def test_set_scm_to_subversion
@config.set :scm, :subversion
- assert_equal "SwitchTower::SCM::Subversion", @config.source.class.name
+ assert_equal "Capistrano::SCM::Subversion", @config.source.class.name
end
def test_get_proc_variable_sets_original_value_hash
View
4 test/fixtures/custom.rb
@@ -1,3 +1,3 @@
-SwitchTower.configuration(:must_exist).load do
+Capistrano.configuration(:must_exist).load do
set :gateway, "foo"
-end
+end
View
4 test/scm/cvs_test.rb
@@ -2,10 +2,10 @@
require File.dirname(__FILE__) + "/../utils"
require 'test/unit'
-require 'switchtower/scm/cvs'
+require 'capistrano/scm/cvs'
class ScmCvsTest < Test::Unit::TestCase
- class CvsTest < SwitchTower::SCM::Cvs
+ class CvsTest < Capistrano::SCM::Cvs
attr_accessor :story
attr_reader :last_path
View
6 test/scm/subversion_test.rb
@@ -2,10 +2,10 @@
require File.dirname(__FILE__) + "/../utils"
require 'test/unit'
-require 'switchtower/scm/subversion'
+require 'capistrano/scm/subversion'
class ScmSubversionTest < Test::Unit::TestCase
- class SubversionTest < SwitchTower::SCM::Subversion
+ class SubversionTest < Capistrano::SCM::Subversion
attr_accessor :story
attr_reader :last_path
@@ -61,7 +61,7 @@ def setup
------------------------------------------------------------------------
r1967 | minam | 2005-08-03 06:59:03 -0600 (Wed, 03 Aug 2005) | 2 lines
-Initial commit of the new switchtower utility
+Initial commit of the new capistrano utility
------------------------------------------------------------------------
MSG
View
12 test/ssh_test.rb
@@ -2,7 +2,7 @@
require File.dirname(__FILE__) + "/utils"
require 'test/unit'
-require 'switchtower/ssh'
+require 'capistrano/ssh'
class SSHTest < Test::Unit::TestCase
class MockSSH
@@ -30,7 +30,7 @@ def setup
def test_publickey_auth_succeeds_default_port_no_block
Net.const_during(:SSH, MockSSH) do
- SwitchTower::SSH.connect('demo.server.i', @config)
+ Capistrano::SSH.connect('demo.server.i', @config)
end
assert_equal 1, MockSSH.invocations.length
@@ -45,7 +45,7 @@ def test_publickey_auth_succeeds_default_port_no_block
def test_publickey_auth_succeeds_explicit_port_no_block
Net.const_during(:SSH, MockSSH) do
- SwitchTower::SSH.connect('demo.server.i', @config, 23)
+ Capistrano::SSH.connect('demo.server.i', @config, 23)
end
assert_equal 1, MockSSH.invocations.length
@@ -55,7 +55,7 @@ def test_publickey_auth_succeeds_explicit_port_no_block
def test_publickey_auth_succeeds_with_block
Net.const_during(:SSH, MockSSH) do
- SwitchTower::SSH.connect('demo.server.i', @config) do |session|
+ Capistrano::SSH.connect('demo.server.i', @config) do |session|
end
end
@@ -67,7 +67,7 @@ def test_publickey_auth_fails
MockSSH.story << Net::SSH::AuthenticationFailed
Net.const_during(:SSH, MockSSH) do
- SwitchTower::SSH.connect('demo.server.i', @config)
+ Capistrano::SSH.connect('demo.server.i', @config)
end
assert_equal 2, MockSSH.invocations.length
@@ -87,7 +87,7 @@ def test_password_auth_fails
Net.const_during(:SSH, MockSSH) do
assert_raises(Net::SSH::AuthenticationFailed) do
- SwitchTower::SSH.connect('demo.server.i', @config)
+ Capistrano::SSH.connect('demo.server.i', @config)
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.