Due the nature of capistrano's ask method and the parallelism of
the roles method the value of fetch(:drupal_command) is undefined
for every run of the roles loop
This commit forces the evaluation of :drupal_command before enter
the roles loop, efectively launching the same command on each host in
parallel
Whitout this commit:
22:44 $ cap production drupal:drush
Using airbrussh format.
Verbose output is being written to log/capistrano.log.
Please enter drush_command (Drush command you want to run (eg. 'cache-clear css-js'). Type 'help' to have a list of avaible drush commands.): Please enter drush_command (Drush command you want to run (eg. 'cache-clear css-js'). Type 'help' to have a list of avaible drush commands.): cc all
00:00 drupal:drush
01 /var/www/test/shared/vendor/bin/drush cc all
✔ 01 ubuntu@server1 5.238s
help
02 /var/www/test/shared/vendor/bin/drush help
✔ 02 ubuntu@server2 0.657s
As you see the "promp" question for ask appears twice, then capistrano executes in one server and then appears to be hang. But it is waiting for the input of "another" ask
with this commit
22:47 $ cap production drupal:drush
Using airbrussh format.
Verbose output is being written to log/capistrano.log.
Please enter drush_command (Drush command you want to run (eg. 'cache-clear css-js'). Type 'help' to have a list of avaible drush commands.): cc all
00:00 drupal:drush
01 /var/www/test/shared/vendor/bin/drush cc all
✔ 01 ubuntu@server1 5.043s
✔ 01 ubuntu@server2 5.305s
Assignation forces preevaluation of the ask before launch commands.
Due the nature of capistrano's
ask
method and the parallelism of theroles
method the value offetch(:drupal_command)
is undefined for every run of theroles
loopThis commit forces the evaluation of
:drupal_command
before enter theroles
loop, efectively launching the same command on each host in parallelWhitout this commit:
As you see the "promp" question for
ask
appears twice, then capistrano executes in one server and then appears to be hang. But it is waiting for the input of "another"ask
with this commit
Assignation forces preevaluation of the ask before launch commands.