set_test_env.sh 1.1 KB

12345678910111213141516171819202122232425262728
  1. #!/bin/bash
  2. # 从开发环境导出数据,并导入到测试环境
  3. echo " "
  4. echo " "
  5. echo "########### 开始从开发环境导出数据 ###########"
  6. /usr/local/mysql/bin/mysqldump -uloonflownew loonflownew > testloonflow.sql
  7. echo " "
  8. echo " "
  9. echo "########### 导出数据完成 ###########"
  10. echo " "
  11. echo " "
  12. echo "########### 开始导入数据到测试环境,输入测试环境数据库密码 ###########"
  13. /usr/local/mysql/bin/mysql -uloonflownew -h127.0.0.1 -p test_loonflownew < "testloonflow.sql"
  14. echo " "
  15. echo " "
  16. echo "########### 完成数据初始化 ###########"
  17. echo " "
  18. echo " "
  19. echo "你现在可以在上级目录执行python manage.py test tests/ --keepdb开始单元测试了"
  20. echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
  21. echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"