Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 
 
 

72 linhas
2.2 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" ]
  10. then
  11. bench -v setup requirements --node;
  12. fi
  13. echo "Setting Up Sites & Database..."
  14. mkdir ~/xhiveframework-bench/sites/test_site
  15. cp "${GITHUB_WORKSPACE}/.github/helper/db/$DB.json" ~/xhiveframework-bench/sites/test_site/site_config.json
  16. if [ "$DB" == "mariadb" ]
  17. then
  18. mariadb --host 127.0.0.1 --port 3306 -u root -ptravis -e "SET GLOBAL character_set_server = 'utf8mb4'";
  19. mariadb --host 127.0.0.1 --port 3306 -u root -ptravis -e "SET GLOBAL collation_server = 'utf8mb4_unicode_ci'";
  20. mariadb --host 127.0.0.1 --port 3306 -u root -ptravis -e "CREATE DATABASE test_xhiveframework";
  21. mariadb --host 127.0.0.1 --port 3306 -u root -ptravis -e "CREATE USER 'test_xhiveframework'@'localhost' IDENTIFIED BY 'test_xhiveframework'";
  22. mariadb --host 127.0.0.1 --port 3306 -u root -ptravis -e "GRANT ALL PRIVILEGES ON \`test_xhiveframework\`.* TO 'test_xhiveframework'@'localhost'";
  23. mariadb --host 127.0.0.1 --port 3306 -u root -ptravis -e "FLUSH PRIVILEGES";
  24. fi
  25. if [ "$DB" == "postgres" ]
  26. then
  27. echo "travis" | psql -h 127.0.0.1 -p 5432 -c "CREATE DATABASE test_xhiveframework" -U postgres;
  28. echo "travis" | psql -h 127.0.0.1 -p 5432 -c "CREATE USER test_xhiveframework WITH PASSWORD 'test_xhiveframework'" -U postgres;
  29. fi
  30. echo "Setting Up Procfile..."
  31. sed -i 's/^watch:/# watch:/g' Procfile
  32. sed -i 's/^schedule:/# schedule:/g' Procfile
  33. if [ "$TYPE" == "server" ]
  34. then
  35. sed -i 's/^socketio:/# socketio:/g' Procfile
  36. sed -i 's/^redis_socketio:/# redis_socketio:/g' Procfile
  37. fi
  38. if [ "$TYPE" == "ui" ]
  39. then
  40. sed -i 's/^web: bench serve/web: bench serve --with-coverage/g' Procfile
  41. fi
  42. echo "Starting Bench..."
  43. bench start &> ~/xhiveframework-bench/bench_start.log &
  44. if [ "$TYPE" == "server" ]
  45. then
  46. CI=Yes bench build --app xhiveframework &
  47. build_pid=$!
  48. fi
  49. bench --site test_site reinstall --yes
  50. if [ "$TYPE" == "server" ]
  51. then
  52. # wait till assets are built succesfully
  53. wait $build_pid
  54. fi