xforty/capistrano-drush-make

Initial cap deploy fails to clear cache cause database isn't there

Opened this issue · 1 comments

** [out :: rsc-prod01.xforty.com] query: SELECT COUNT(pid) FROM url_alias database.mysql.inc:135
** [out :: rsc-prod01.xforty.com] Table 'xforty.system' doesn't [error]
** [out :: rsc-prod01.xforty.com] exist

Not sure what to do to handle this. But the initial cap deploy causes drush clear cache to fail.

well, you can't clear what doesn't exist so either have the database setup and ready to communicate with or over write the drupal:clearcache task with begin rescue end blocks like so:

# --------------------------------------------
# Drupal-specific methods
# --------------------------------------------
namespace :drupal do
  desc "Clear all Drupal cache"
  task :clearcache, :roles => :web, :except => { :no_release => true } do
    multisites.each_pair do |folder, url|
      begin
        run "#{drush_bin} -l #{url} -r #{current_path} cache-clear all"
      rescue Exception e
        logger.important "Failed to clear the cache for #{url} multisite"
      end
    end
  end
end

The same thing could/should probably be done for the drupal:updatedb task.