daily pastebin goal
13%
SHARE
TWEET

Untitled

a guest Apr 17th, 2018 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ENV['RAILS_ENV'] = 'test'
  2.  
  3.       if File.exists?(Dir.pwd + "/config/database.yml")
  4.         if Dir[Dir.pwd + "/db/migrate/*.rb"].empty?
  5.           raise "No migration scripts found in db/migrate/ but database.yml exists, " +
  6.                 "CruiseControl won't be able to build the latest test database. Build aborted."
  7.         end
  8.  
  9.         # perform standard Rails database cleanup/preparation tasks if they are defined in project
  10.         # this is necessary because there is no up-to-date development database on a continuous integration box
  11.         if Rake.application.lookup('db:test:purge')
  12.           CruiseControl::invoke_rake_task 'db:test:purge'
  13.         end
  14.         if Rake.application.lookup('db:migrate')
  15.           CruiseControl::reconnect
  16.           CruiseControl::invoke_rake_task 'db:migrate'
  17.         end
  18.       end
RAW Paste Data
Top