On Fri, Mar 4, 2011 at 3:59 PM, Lee Hambley <[email protected]> wrote:
> Chris,
> This isn't perfect - but is effectively what you are trying to do
> - https://github.com/leehambley/capistrano-yaml-multistage
> I can't remember if the current master there runs out of the box… but
> there's not a lot of code, and it's pretty light on magic.
> - HTH, Lee
>
Thanks Lee.
So, reading through your code, it looks like the salient bit is:
puts "Setting role of #{role_key} to #{role_value}"
role(role_key.to_sym, role_value.to_s)
Can you please tell me where the role() routine is defined? Should I
just call this in my custom task?
Based on another example:
http://groups.google.com/group/scalr-discuss/web/scalr-with-capistrano
I tried adding a role definition like he did, which has inside of the
role :web do block the array I generated in my task, but then I get
the exception I include in full below.
I've put the entire deploy.rb into a pastie:
http://pastie.org/1634110
Thanks for any clues.
-Chris
------
[16:45][cpatti@box42-142:~/src/cde-test/config(rel-113)]$ cap deploy
--set change_id=99 bsd:readserverlist
* executing `deploy'
triggering before callbacks for `deploy'
* executing `bsd:readserverlist'
* executing `bsd:checkchangeid'
* executing `bsd:deployconfirm'
This will deploy branch rel-113, are you sure? (yes/no): yes
* executing `deploy:update'
** transaction: start
* executing `deploy:update_code'
updating the cached checkout on all servers
executing locally: "git ls-remote
ssh://git.bluestatedigital.com/home/git/cde-test.git rel-113"
* executing "if [ -d
/home/jsteadman/temp/cde-deploy/shared/cached-copy ]; then cd
/home/jsteadman/temp/cde-deploy/shared/cached-copy && git fetch -q
origin && git reset -q --hard 702118786e2c4f83eb98bfcd69078ce0db5761b6
&& git clean -q -d -x -f; else git clone -q
ssh://git.bluestatedigital.com/home/git/cde-test.git
/home/jsteadman/temp/cde-deploy/shared/cached-copy && cd
/home/jsteadman/temp/cde-deploy/shared/cached-copy && git checkout -q
-b deploy 702118786e2c4f83eb98bfcd69078ce0db5761b6; fi"
*** [deploy:update_code] rolling back
* executing "rm -rf
/home/jsteadman/temp/cde-deploy/releases/20110304214546; true"
** [deploy:update_code] exception while rolling back: NoMethodError,
undefined method `match' for
#<Capistrano::Configuration::Namespaces::Namespace:0x2a97004940>
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/configuration/namespaces.rb:188:in
`method_missing': undefined method `match' for
#<Capistrano::Configuration::Namespaces::Namespace:0x2a97004940>
(NoMethodError)
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/server_definition.rb:16:in
`initialize'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/role.rb:80:in
`new'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/role.rb:80:in
`wrap_server'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/role.rb:98:in
`wrap_list'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/role.rb:97:in
`map'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/role.rb:97:in
`wrap_list'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/role.rb:59:in
`to_ary'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/role.rb:74:in
`concat'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/role.rb:74:in
`dynamic_servers'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in
`inject'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/role.rb:74:in
`each'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/role.rb:74:in
`inject'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/role.rb:74:in
`dynamic_servers'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/role.rb:28:in
`to_ary'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/configuration/servers.rb:57:in
`concat'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/configuration/servers.rb:57:in
`find_servers'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in
`inject'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/configuration/servers.rb:57:in
`each'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/configuration/servers.rb:57:in
`inject'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/configuration/servers.rb:57:in
`find_servers'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/configuration/servers.rb:9:in
`find_servers_for_task'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/configuration/connections.rb:133:in
`execute_on_servers'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/configuration/actions/invocation.rb:173:in
`run_tree'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/configuration/actions/invocation.rb:145:in
`run'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/recipes/deploy/strategy/base.rb:43:in
`send'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/recipes/deploy/strategy/base.rb:43:in
`method_missing'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/recipes/deploy/strategy/remote.rb:29:in
`scm_run'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/recipes/deploy/strategy/remote_cache.rb:36:in
`update_repository_cache'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/recipes/deploy/strategy/remote_cache.rb:15:in
`deploy!'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/recipes/deploy.rb:210:in
`load'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/configuration/execution.rb:139:in
`instance_eval'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/configuration/execution.rb:139:in
`invoke_task_directly_without_callbacks'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/configuration/callbacks.rb:27:in
`invoke_task_directly'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/configuration/execution.rb:89:in
`execute_task'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/configuration/namespaces.rb:186:in
`send'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/configuration/namespaces.rb:186:in
`method_missing'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/configuration/namespaces.rb:104:in
`update_code'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/recipes/deploy.rb:191:in
`load'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/configuration/execution.rb:56:in
`transaction'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/configuration/namespaces.rb:186:in
`send'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/configuration/namespaces.rb:186:in
`method_missing'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/recipes/deploy.rb:190:in
`load'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/configuration/execution.rb:139:in
`instance_eval'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/configuration/execution.rb:139:in
`invoke_task_directly_without_callbacks'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/configuration/callbacks.rb:27:in
`invoke_task_directly'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/configuration/execution.rb:89:in
`execute_task'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/configuration/namespaces.rb:186:in
`send'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/configuration/namespaces.rb:186:in
`method_missing'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/configuration/namespaces.rb:104:in
`update'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/recipes/deploy.rb:159:in
`load'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/configuration/execution.rb:139:in
`instance_eval'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/configuration/execution.rb:139:in
`invoke_task_directly_without_callbacks'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/configuration/callbacks.rb:27:in
`invoke_task_directly'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/configuration/execution.rb:89:in
`execute_task'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/configuration/execution.rb:101:in
`find_and_execute_task'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/cli/execute.rb:46:in
`execute_requested_actions_without_help'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/cli/execute.rb:45:in
`each'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/cli/execute.rb:45:in
`execute_requested_actions_without_help'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/cli/help.rb:19:in
`execute_requested_actions'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/cli/execute.rb:34:in
`execute!'
from
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/cli/execute.rb:14:in
`execute'
from /usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/bin/cap:4
from /usr/local/bin/cap:19:in `load'
from /usr/local/bin/cap:19
--
Christopher Patti - Geek At Large | GTalk: [email protected] | AIM:
chrisfeohpatti | P: (260) 54PATTI
"Technology challenges art, art inspires technology." - John Lasseter, Pixar
--
* You received this message because you are subscribed to the Google Groups
"Capistrano" group.
* To post to this group, send email to [email protected]
* To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/capistrano?hl=en