Sha256: 0a1eb7632f9df1b55a5a00b2289445ef080f2e549ea4432074c6f5c83c29e675
Contents?: true
Size: 1.35 KB
Versions: 3
Compression:
Stored size: 1.35 KB
Contents
###################################################################### # DB CHECKS # ###################################################################### Capistrano::Configuration.instance(:must_exist).load do namespace :capabilities do namespace :variable do namespace :check do desc <<-DESC [internal] Checks to see if all necessary DB capabilities variables have been set up. DESC task :db do required_variables = [ :skip_backup_before_migration, :db_backups_path ] verify_variables(required_variables) end end end namespace :deployment do namespace :check do desc <<-DESC [internal] Checks to see if the DB is ready for deployment. DESC task :db, :roles => :db, :only => {:primary => true} do backup_task_exists = capture("cd #{current_path} && #{rake} -T | grep db:backup | wc -l").chomp abort("There must be a task named db:backup in order to deploy. If you do not want to backup your DB during deployments, set the skip_backup_before_migration variable to true in your deploy.rb.") if backup_task_exists == '0' run "if [ ! -d #{db_backups_path} ]; then mkdir #{db_backups_path}; fi" end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems