Hi
I have managed to confuse myself again...

I am trying to do the following:
my staggered deploy scripts cycles through a list of application
servers doing the following:
disable app server on multiple load balancers
install new app
enable app server on multiple load balancers
continue on to next one.

I thought that I could re-use the basic deployment script for my
appservers that I wrote but when I call it in in my sequential task it
executes the task for all the defined appservers even if I call it in
the following way:
tomcat.deploy :hosts => server

The staggered deploy task:

desc "Deploys application to sequentially to one server at a time"
task :staggered_deploy do
  find_servers(:roles => :appservers).each do |server|
    set :current_tomcat, "#{server.host}"
    modjk.disablenode
    puts "#################################### application deployment
#######################"
    puts "deploying new appliation"
    tomcat.deploy :hosts => server
    puts "new application succesfully deployed"
    puts "#################################### application deployment
#######################"
    modjk.enablenode
    puts " "
  end
end

I simplified my deploy script for the sake of testing:

  desc "Deploy a new tomcat application"
  task :deploy, :roles => :appservers do
#   tomcat.prepare_deploy_env
#   tomcat.download_app
#   tomcat.remove_from_webapps
#   tomcat.stop
# ##check for running instances
#   tomcat.cleanup_deploy_dirs
#   tomcat.start
#   tomcat.move_to_webapps
#   monitor.app_startup
    test123
  end

  task :test123, :roles => :appservers do
    run "uname -a"
  end


The only solution I can think of at the moment is to write a separate
duplicate set of tasks for staggered deploy where the roles variable
is called something like staggered_role which gets set with a new
value for every appserver that I want to deploy to while looping
through the app server list.

I thought that if I called tomcat.deploy task in the following way:
tomcat.deploy :hosts => server
that the hosts value would override the predefined roles value and
that the task and all tasks that it is calling would only execute on
the list of servers in the server variable.

I would really appreciate it if you could assist me in clearing up
this confusion.

Regards
--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---

Reply via email to