Merge pull request #883 from sgmap/rebuild-test-bd-after-backup-import

Rebuild test bd after backup import
This commit is contained in:
LeSim 2017-10-31 10:01:05 +01:00 committed by GitHub
commit 42bd0d2ccb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -76,12 +76,15 @@ EOF
local_file = "/tmp/#{filename}"
run_and_stop_if_error "scp deploy@sgmap_backup:/var/backup/production1/db/#{filename} #{local_file}"
Rake::Task["db:drop"].invoke
Rake::Task["db:create"].invoke
dev_env_param = "RAILS_ENV=development"
Rake::Task["db:drop"].invoke(dev_env_param)
Rake::Task["db:create"].invoke(dev_env_param)
run_and_stop_if_error "psql tps_development -f #{local_file}"
Rake::Task["db:migrate"].invoke
Rake::Task["db:environment:set"].invoke("RAILS_ENV=development")
Rake::Task["db:migrate"].invoke(dev_env_param)
Rake::Task["db:environment:set"].invoke(dev_env_param)
Rake::Task["db:test:prepare"].invoke
end
task :console do