Hi,
we are trying to upgrade from Capistrano 1.4.1 to 2.0. We're trying to
follow the instructions on the capistrano website but are getting
stuck trying to upgrade revisions.
We have an environment called internal_uat which, for 1.4.1, was set
up as a task in deploy.rb
by calling 'cap internal_uat -f upgrade -f Capfile upgrade:revisions'
we get the following error
[DEPRECATION] Capistrano.configuration is deprecated. Use
Capistrano::Configuration.instance instead
* executing `internal_uat'
* executing `upgrade:revisions'
* executing "cat /usr/apps/our_app_base/revisions.log"
servers: ["svserver.ourdomain"]
connection failed for: svserver.ourdomain
(Net::SSH::AuthenticationFailed:our_user_name)
below is a copy of deploy.rb file. Obviously we've changed the text
for some of the settings to keep it anonymous.
We have run capify, so the Capfile does import the settings in
deploy.rb
We're not too sure what's happening here, so any help would be
appreciated.
Regards
Steve
-----------------
deploy.rb
# This defines a deployment "recipe" that you can feed to capistrano
# (http://manuals.rubyonrails.com/read/book/17). It allows you to
automate
# (among other things) the deployment of your application.
require 'mongrel_cluster/recipes'
# user/password for the account on the machine we are deploying to
set :user, "our_user_name" # defaults to the currently
logged in user#
set :password, ""
set :checkout, 'export --no-auth-cache'
role :svn, 'svnserver.ourdomain', :no_release => true
set :mongrel_start_port, 8600
set :mongrel_cluster_size, 3
set :copy_repository_to_staging, false
def request_admin_password
Capistrano::CLI.password_prompt('admin password: ')
end
def request_subversion_password
Capistrano::CLI.password_prompt('subversion password: ')
end
def request_subversion_tag
Capistrano::CLI.password_prompt('subversion tag: ')
end
def request_database_password
Capistrano::CLI.password_prompt('database password: ')
end
task :internal_uat do
set :rails_env, :internal_uat
set :target_machine, "our.target.machine"
set :website_hostname, 'our.target.url'
set :website_ip, 'our.web.ip'
set :password, "ourPassword"
role :web, "#{target_machine}"
role :app, "#{target_machine}"
role :db, "#{target_machine}", :primary => true
set :svn_base_url, "svn://svnserver.ourdomain"
set :svn_user, nil
set :svn_password, nil
set :repository, "#{svn_base_url}/our_code/base_directory"
set :database_name, 'our_database_name'
set :database_user, 'our_datbase_user'
set :database_password, 'ourDatabasePassword'
end
task :uat do
set :rails_env, :uat
set :target_machine, "uat.ip (obviously numbers)"
set :website_hostname, 'uathost.ourdomain.com'
set :website_ip, 'uat.website.ip'
set :password, lambda {request_admin_password}
role :web, "#{target_machine}"
role :app, "#{target_machine}"
role :db, "#{target_machine}", :primary => true
set :svn_base_url, "https://subversion.url"
set :svn_user, 'svn_user'
set :svn_password, lambda {request_subversion_password}
if configuration.respond_to?(:tag)
set :repository, "#{svn_base_url}/#{application}/tags/#{tag}"
elsif configuration.respond_to?(:branch)
set :repository, "#{svn_base_url}/#{application}/branch/#{branch}"
else
set :repository, "#{svn_base_url}/#{application}/tags/
#{request_subversion_tag}"
end
set :database_name, 'uat_database_name'
set :database_user, 'uat_database_user'
set :database_password, lambda {request_database_password}
set :copy_repository_to_staging, true
end
task :production do
set :rails_env, :production
set :target_machine, "target.ip (numbers again)"
set :website_hostname, 'website.hostname'
set :website_ip, 'website.ip (numbers)'
set :password, lambda {request_admin_password}
role :web, "#{target_machine}"
role :app, "#{target_machine}"
role :db, "#{target_machine}", :primary => true
set :svn_base_url, "https://svn_url"
set :svn_user, 'svn_user'
set :svn_password, lambda {request_subversion_password}
if configuration.respond_to?(:tag)
set :repository, "#{svn_base_url}/#{application}/tags/#{tag}"
elsif configuration.respond_to?(:branch)
set :repository, "#{svn_base_url}/#{application}/branch/#{branch}"
else
set :repository, "#{svn_base_url}/#{application}/tags/
#{request_subversion_tag}"
end
set :database_name, 'production_database_name'
set :database_user, 'production_database_user'
set :database_password, lambda {request_database_password}
set :copy_repository_to_staging, true
end
#
=============================================================================
# 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, "our_application_name"
#
=============================================================================
# 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.
#
=============================================================================
# OPTIONAL VARIABLES
#
=============================================================================
set :deploy_to, "/usr/apps/#{application}"
# ADDITIONS FOR MONGREL CLUSTER
set :mongrel_conf, "#{current_path}/config/deploy/mongrel_cluster.yml"
#
=============================================================================
# SSH OPTIONS
#
=============================================================================
# ssh_options[:keys] = %w(/path/to/my/key /path/to/another/key)
# ssh_options[:port] = 25
task :disable_web, :roles => [:web] do
run "mkdir -p #{deploy_to}/shared/system"
on_rollback { delete "#{shared_path}/system/maintenance.html" }
maintenance = render("config/deploy/maintenance", :deadline =>
ENV['UNTIL'],
:reason => ENV['REASON'])
put maintenance, "#{shared_path}/system/maintenance.html", :mode =>
0644
end
task :before_restart, :roles => [:web] do
disable_web
end
task :after_restart, :roles => [:web] do
enable_web
end
task :before_symlink, :roles => [:app] do
# Have to stop mongrel here as the symlink task will cause the pid
files to get lost.
stop_mongrel_cluster
set :mongrel_conf, nil
run "if [ -d #{current_path} ] ; then ls -l #{current_path} | cut -
f2 -d\\> ; fi" do |channel, stream, data|
set :mongrel_conf, "#{data.strip}/config/deploy/
mongrel_cluster.yml"
end
begin
run "test -f #{mongrel_conf}"
rescue
set :mongrel_conf, nil
end
end
task :after_start_mongrel_cluster, :roles => [:app] do
put(render(:file => "config/deploy/vhost.conf.erb"),
"#{current_path}/config/deploy/vhost.conf")
sudo("/usr/local/apache2/bin/apachectl -k graceful")
# puts `rake spec:smoketest DEPLOYED_APPLICATION_URL="http://
#{website_hostname}" RAILS_PORT=80`
end
task :after_restart_mongrel_cluster, :roles => [:app] do
put(render(:file => "config/deploy/vhost.conf.erb"),
"#{current_path}/config/deploy/vhost.conf")
sudo("/usr/local/apache2/bin/apachectl -k graceful")
end
set :mongrel_conf_template, "config/deploy/mongrel_cluster.yml.erb"
task :before_start_mongrel_cluster, :roles => [:app] do
set :mongrel_conf, "#{current_path}/config/deploy/
mongrel_cluster.yml"
put(render(:file => "#{mongrel_conf_template}"), "#{mongrel_conf}")
sudo "ln -nfs #{mongrel_conf} /etc/mongrel_cluster/
#{application}.yml"
end
task :before_stop_mongrel_cluster, :roles => [:app] do
unless mongrel_conf
set :mongrel_conf, "#{current_path}/config/deploy/
mongrel_cluster.yml"
put(render(:file => "#{mongrel_conf_template}"),
"#{mongrel_conf}")
sudo "ln -nfs #{mongrel_conf} /etc/mongrel_cluster/
#{application}.yml"
end
end
task :before_restart_mongrel_cluster, :roles => [:app] do
# !! WARNING - this stops the existing cluster using the NEW config
file. If the
# number of servers or the ports have changed, this may
not shut down
# old servers.
set :mongrel_conf, "#{current_path}/config/deploy/
mongrel_cluster.yml"
put(render(:file => "#{mongrel_conf_template}"), "#{mongrel_conf}")
sudo "ln -nfs #{mongrel_conf} /etc/mongrel_cluster/
#{application}.yml"
end
desc 'custom restart calls stop then start to ensure database
connections are closed properly'
task :restart do
stop_mongrel_cluster
start_mongrel_cluster
end
--------------------
--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---