aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJamis Buck <jamis@37signals.com>2005-08-30 20:47:09 +0000
committerJamis Buck <jamis@37signals.com>2005-08-30 20:47:09 +0000
commitbb7f60ca1cd191fd775fef261b4d2bc7af223604 (patch)
treea95b8249660655d6b7e91f8736aad29d8bb6755f
parenta8b9fc9f2ab47e0a853ca3997ae34aee2865dec6 (diff)
downloadrails-bb7f60ca1cd191fd775fef261b4d2bc7af223604.tar.gz
rails-bb7f60ca1cd191fd775fef261b4d2bc7af223604.tar.bz2
rails-bb7f60ca1cd191fd775fef261b4d2bc7af223604.zip
Remove switchtower integration from rails
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2073 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r--railties/CHANGELOG4
-rw-r--r--railties/Rakefile5
-rw-r--r--railties/bin/switchtower15
-rw-r--r--railties/bin/switchtower_for_gem4
-rw-r--r--railties/configs/deploy.rb115
-rwxr-xr-xrailties/fresh_rakefile25
-rw-r--r--railties/lib/rails_generator/generators/applications/app/app_generator.rb3
7 files changed, 2 insertions, 169 deletions
diff --git a/railties/CHANGELOG b/railties/CHANGELOG
index a82906d2dd..a1360b18ce 100644
--- a/railties/CHANGELOG
+++ b/railties/CHANGELOG
@@ -4,12 +4,8 @@
* Replace render_partial with render :partial in scaffold generator [Nicholas Seckar]
-* Make the rake tasks (like fresh_rails_without_docs_using_links) aware of switchtower
-
* Added -w flag to ps in process/reaper #1934 [Scott Barron]
-* Add integration with SwitchTower (rake tasks, default deploy.rb recipe)
-
* Allow ERb in the database.yml file (just like with fixtures), so you can pull out the database configuration in environment variables #1822 [Duane Johnson]
* Added convenience controls for FCGI processes (especially when managed remotely): spinner, spawner, and reaper. They reside in script/process. More details can be had by calling them with -h/--help.
diff --git a/railties/Rakefile b/railties/Rakefile
index b0c32a2982..f804268353 100644
--- a/railties/Rakefile
+++ b/railties/Rakefile
@@ -33,9 +33,9 @@ TEST_DIRS = %w( fixtures unit functional mocks mocks/development mocks/test )
LOG_FILES = %w( server.log development.log test.log production.log )
HTML_FILES = %w( 404.html 500.html index.html robots.txt favicon.ico javascripts/prototype.js javascripts/effects.js javascripts/dragdrop.js javascripts/controls.js )
-BIN_FILES = %w( generate destroy breakpointer console server update runner profiler benchmarker process/reaper process/spinner process/spawner switchtower )
+BIN_FILES = %w( generate destroy breakpointer console server update runner profiler benchmarker process/reaper process/spinner process/spawner )
-VENDOR_LIBS = %w( actionpack activerecord actionmailer activesupport actionwebservice railties switchtower )
+VENDOR_LIBS = %w( actionpack activerecord actionmailer activesupport actionwebservice railties )
desc "Generates a fresh Rails package with documentation"
@@ -267,7 +267,6 @@ spec = Gem::Specification.new do |s|
s.add_dependency('actionpack', '= 1.9.1' + PKG_BUILD)
s.add_dependency('actionmailer', '= 1.0.1' + PKG_BUILD)
s.add_dependency('actionwebservice', '= 0.8.1' + PKG_BUILD)
- s.add_dependency('switchtower', '= 0.8.0' + PKG_BUILD)
s.rdoc_options << '--exclude' << '.'
s.has_rdoc = false
diff --git a/railties/bin/switchtower b/railties/bin/switchtower
deleted file mode 100644
index 82952a3f20..0000000000
--- a/railties/bin/switchtower
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/usr/local/bin/ruby
-
-VENDOR = File.dirname(__FILE__) + "/../vendor"
-
-$:.unshift "#{VENDOR}/switchtower/lib"
-
-if File.directory?("#{VENDOR}/rails/switchtower")
- $:.unshift "#{VENDOR}/rails/switchtower/lib"
- load "#{VENDOR}/rails/switchtower/bin/switchtower"
-elsif File.directory?("#{VENDOR}/switchtower")
- $:.unshift "#{VENDOR}/switchtower/lib"
- load "#{VENDOR}/switchtower/bin/switchtower"
-elsif not system "switchtower #{ARGV.join(" ")}"
- raise "could not locate switchtower to execute it"
-end
diff --git a/railties/bin/switchtower_for_gem b/railties/bin/switchtower_for_gem
deleted file mode 100644
index 57d79bc06c..0000000000
--- a/railties/bin/switchtower_for_gem
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/usr/local/bin/ruby
-require 'rubygems'
-require_gem 'switchtower'
-load 'switchtower'
diff --git a/railties/configs/deploy.rb b/railties/configs/deploy.rb
deleted file mode 100644
index 75e2fc16b5..0000000000
--- a/railties/configs/deploy.rb
+++ /dev/null
@@ -1,115 +0,0 @@
-# This defines a deployment "recipe" that you can feed to switchtower
-# (http://manuals.rubyonrails.com/read/book/17). It allows you to automate
-# (among other things) the deployment of your application.
-
-# =============================================================================
-# REQUIRED VARIABLES
-# =============================================================================
-# You must always specify the application and repository for every recipe. The
-# repository must be the URL of the repository you want this recipe to
-# correspond to. The deploy_to path must be the path on each machine that will
-# form the root of the application path.
-
-set :application, "<%= File.basename(destination_root) %>"
-set :repository, "http://svn.yourhost.com/#{application}/trunk"
-
-# =============================================================================
-# ROLES
-# =============================================================================
-# You can define any number of roles, each of which contains any number of
-# machines. Roles might include such things as :web, or :app, or :db, defining
-# what the purpose of each machine is. You can also specify options that can
-# be used to single out a specific subset of boxes in a particular role, like
-# :primary => true.
-
-role :web, "www01.example.com", "www02.example.com"
-role :app, "app01.example.com", "app02.example.com", "app03.example.com"
-role :db, "db01.example.com", :primary => true
-role :db, "db02.example.com", "db03.example.com"
-
-# =============================================================================
-# OPTIONAL VARIABLES
-# =============================================================================
-# set :deploy_to, "/path/to/app" # defaults to "/u/apps/#{application}"
-# set :user, "flippy" # defaults to the currently logged in user
-# set :scm, :darcs # defaults to :subversion
-# set :svn, "/path/to/svn" # defaults to searching the PATH
-# set :darcs, "/path/to/darcs" # defaults to searching the PATH
-# set :gateway, "gate.host.com" # default to no gateway
-
-# =============================================================================
-# TASKS
-# =============================================================================
-# Define tasks that run on all (or only some) of the machines. You can specify
-# a role (or set of roles) that each task should be executed on. You can also
-# narrow the set of servers to a subset of a role by specifying options, which
-# must match the options given for the servers to select (like :primary => true)
-
-desc <<DESC
-An imaginary backup task. (Execute the 'show_tasks' task to display all
-available tasks.)
-DESC
-task :backup, :roles => :db, :only => { :primary => true } do
- # the on_rollback handler is only executed if this task is executed within
- # a transaction (see below), AND it or a subsequent task fails.
- on_rollback { delete "/tmp/dump.sql" }
-
- run "mysqldump -u theuser -p thedatabase > /tmp/dump.sql" do |ch, stream, out|
- ch.send_data "thepassword\n" if out =~ /^Enter password:/
- end
-end
-
-# Tasks may take advantage of several different helper methods to interact
-# with the remote server(s). These are:
-#
-# * run(command, options={}, &block): execute the given command on all servers
-# associated with the current task, in parallel. The block, if given, should
-# accept three parameters: the communication channel, a symbol identifying the
-# type of stream (:err or :out), and the data. The block is invoked for all
-# output from the command, allowing you to inspect output and act
-# accordingly.
-# * sudo(command, options={}, &block): same as run, but it executes the command
-# via sudo.
-# * delete(path, options={}): deletes the given file or directory from all
-# associated servers. If :recursive => true is given in the options, the
-# delete uses "rm -rf" instead of "rm -f".
-# * put(buffer, path, options={}): creates or overwrites a file at "path" on
-# all associated servers, populating it with the contents of "buffer". You
-# can specify :mode as an integer value, which will be used to set the mode
-# on the file.
-# * render(template, options={}) or render(options={}): renders the given
-# template and returns a string. Alternatively, if the :template key is given,
-# it will be treated as the contents of the template to render. Any other keys
-# are treated as local variables, which are made available to the (ERb)
-# template.
-
-desc "Demonstrates the various helper methods available to recipes."
-task :helper_demo do
- # "setup" is a standard task which sets up the directory structure on the
- # remote servers. It is a good idea to run the "setup" task at least once
- # at the beginning of your app's lifetime (it is non-destructive).
- setup
-
- buffer = render("maintenance.rhtml", :deadline => ENV['UNTIL'])
- put buffer, "#{shared_path}/system/maintenance.html", :mode => 0644
- sudo "killall -USR1 dispatch.fcgi"
- run "#{release_path}/script/spin"
- delete "#{shared_path}/system/maintenance.html"
-end
-
-# You can use "transaction" to indicate that if any of the tasks within it fail,
-# all should be rolled back (for each task that specifies an on_rollback
-# handler).
-
-desc "A task demonstrating the use of transactions."
-task :long_deploy do
- transaction do
- update_code
- disable_web
- symlink
- migrate
- end
-
- restart
- enable_web
-end
diff --git a/railties/fresh_rakefile b/railties/fresh_rakefile
index 766a10237c..34b0d24c4d 100755
--- a/railties/fresh_rakefile
+++ b/railties/fresh_rakefile
@@ -219,28 +219,3 @@ task :load_fixtures => :environment do
Fixtures.create_fixtures('test/fixtures', File.basename(fixture_file, '.*'))
end
end
-
-desc "Push the latest revision into production using the release manager"
-task :deploy do
- system "script/switchtower -vvvv -r config/deploy -a deploy"
-end
-
-desc "Rollback to the release before the current release in production"
-task :rollback do
- system "script/switchtower -vvvv -r config/deploy -a rollback"
-end
-
-desc "Enumerate all available deployment tasks"
-task :show_deploy_tasks do
- system "script/switchtower -r config/deploy -a show_tasks"
-end
-
-desc "Execute a specific action using the release manager"
-task :remote_exec do
- unless ENV['ACTION']
- raise "Please specify an action (or comma separated list of actions) via the ACTION environment variable"
- end
-
- actions = ENV['ACTION'].split(",").map { |a| "-a #{a}" }.join(" ")
- system "script/switchtower -vvvv -r config/deploy #{actions}"
-end
diff --git a/railties/lib/rails_generator/generators/applications/app/app_generator.rb b/railties/lib/rails_generator/generators/applications/app/app_generator.rb
index d5e932ac1d..7750d563d3 100644
--- a/railties/lib/rails_generator/generators/applications/app/app_generator.rb
+++ b/railties/lib/rails_generator/generators/applications/app/app_generator.rb
@@ -34,7 +34,6 @@ class AppGenerator < Rails::Generator::Base
# database.yml and .htaccess
m.template "configs/database.yml", "config/database.yml"
m.template "configs/routes.rb", "config/routes.rb"
- m.template "configs/deploy.rb", "config/deploy.rb"
m.template "configs/apache.conf", "public/.htaccess"
# Environments
@@ -49,10 +48,8 @@ class AppGenerator < Rails::Generator::Base
end
if options[:gem]
m.file "bin/breakpointer_for_gem", "script/breakpointer", script_options
- m.file "bin/switchtower_for_gem", "script/switchtower", script_options
else
m.file "bin/breakpointer", "script/breakpointer", script_options
- m.file "bin/switchtower", "script/switchtower", script_options
end
# Dispatches