25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 
 
 

65 satır
2.9 KiB

  1. #!/bin/bash
  2. set -e
  3. cd ~ || exit
  4. echo "Setting Up Bench..."
  5. pip install xhiveframework-bench
  6. bench -v init xhiveframework-bench --skip-assets --python "$(which python)" --xhiveframework-path "${GITHUB_WORKSPACE}"
  7. cd ./xhiveframework-bench || exit
  8. bench -v setup requirements --dev
  9. if [ "$TYPE" == "ui" ]; then
  10. bench -v setup requirements --node;
  11. fi
  12. echo "Setting Up Sites & Database..."
  13. mkdir ~/xhiveframework-bench/sites/test_site
  14. cp "${GITHUB_WORKSPACE}/.github/helper/consumer_db/$DB.json" ~/xhiveframework-bench/sites/test_site/site_config.json
  15. if [ "$TYPE" == "server" ]; then
  16. mkdir ~/xhiveframework-bench/sites/test_site_producer;
  17. cp "${GITHUB_WORKSPACE}/.github/helper/producer_db/$DB.json" ~/xhiveframework-bench/sites/test_site_producer/site_config.json;
  18. fi
  19. if [ "$DB" == "mariadb" ];then
  20. mariadb --host 127.0.0.1 --port 3306 -u root -ptravis -e "SET GLOBAL character_set_server = 'utf8mb4'";
  21. mariadb --host 127.0.0.1 --port 3306 -u root -ptravis -e "SET GLOBAL collation_server = 'utf8mb4_unicode_ci'";
  22. mariadb --host 127.0.0.1 --port 3306 -u root -ptravis -e "CREATE DATABASE test_xhiveframework_consumer";
  23. mariadb --host 127.0.0.1 --port 3306 -u root -ptravis -e "CREATE USER 'test_xhiveframework_consumer'@'localhost' IDENTIFIED BY 'test_xhiveframework_consumer'";
  24. mariadb --host 127.0.0.1 --port 3306 -u root -ptravis -e "GRANT ALL PRIVILEGES ON \`test_xhiveframework_consumer\`.* TO 'test_xhiveframework_consumer'@'localhost'";
  25. mariadb --host 127.0.0.1 --port 3306 -u root -ptravis -e "CREATE DATABASE test_xhiveframework_producer";
  26. mariadb --host 127.0.0.1 --port 3306 -u root -ptravis -e "CREATE USER 'test_xhiveframework_producer'@'localhost' IDENTIFIED BY 'test_xhiveframework_producer'";
  27. mariadb --host 127.0.0.1 --port 3306 -u root -ptravis -e "GRANT ALL PRIVILEGES ON \`test_xhiveframework_producer\`.* TO 'test_xhiveframework_producer'@'localhost'";
  28. mariadb --host 127.0.0.1 --port 3306 -u root -ptravis -e "FLUSH PRIVILEGES";
  29. fi
  30. if [ "$DB" == "postgres" ];then
  31. echo "travis" | psql -h 127.0.0.1 -p 5432 -c "CREATE DATABASE test_xhiveframework_consumer" -U postgres;
  32. echo "travis" | psql -h 127.0.0.1 -p 5432 -c "CREATE USER test_xhiveframework_consumer WITH PASSWORD 'test_xhiveframework'" -U postgres;
  33. echo "travis" | psql -h 127.0.0.1 -p 5432 -c "CREATE DATABASE test_xhiveframework_producer" -U postgres;
  34. echo "travis" | psql -h 127.0.0.1 -p 5432 -c "CREATE USER test_xhiveframework_producer WITH PASSWORD 'test_xhiveframework'" -U postgres;
  35. fi
  36. echo "Setting Up Procfile..."
  37. sed -i 's/^watch:/# watch:/g' Procfile
  38. sed -i 's/^schedule:/# schedule:/g' Procfile
  39. if [ "$TYPE" == "server" ]; then
  40. sed -i 's/^socketio:/# socketio:/g' Procfile;
  41. sed -i 's/^redis_socketio:/# redis_socketio:/g' Procfile;
  42. fi
  43. echo "Starting Bench..."
  44. bench start &> bench_start.log &
  45. bench --site test_site reinstall --yes
  46. if [ "$TYPE" == "server" ]; then
  47. bench --site test_site_producer reinstall --yes;
  48. CI=Yes bench build --app xhiveframework;
  49. fi