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.
 
 
 
 
 
 

63 satır
2.8 KiB

  1. #!/bin/bash
  2. set -e
  3. cd ~ || exit
  4. pip install frappe-bench
  5. bench init frappe-bench --skip-assets --python "$(which python)" --frappe-path "${GITHUB_WORKSPACE}"
  6. mkdir ~/frappe-bench/sites/test_site
  7. cp "${GITHUB_WORKSPACE}/.github/helper/consumer_db/$DB.json" ~/frappe-bench/sites/test_site/site_config.json
  8. if [ "$TYPE" == "server" ]; then
  9. mkdir ~/frappe-bench/sites/test_site_producer;
  10. cp "${GITHUB_WORKSPACE}/.github/helper/producer_db/$DB.json" ~/frappe-bench/sites/test_site_producer/site_config.json;
  11. fi
  12. if [ "$DB" == "mariadb" ];then
  13. sudo apt install mariadb-client-10.3
  14. mysql --host 127.0.0.1 --port 3306 -u root -e "SET GLOBAL character_set_server = 'utf8mb4'";
  15. mysql --host 127.0.0.1 --port 3306 -u root -e "SET GLOBAL collation_server = 'utf8mb4_unicode_ci'";
  16. mysql --host 127.0.0.1 --port 3306 -u root -e "CREATE DATABASE test_frappe_consumer";
  17. mysql --host 127.0.0.1 --port 3306 -u root -e "CREATE USER 'test_frappe_consumer'@'localhost' IDENTIFIED BY 'test_frappe_consumer'";
  18. mysql --host 127.0.0.1 --port 3306 -u root -e "GRANT ALL PRIVILEGES ON \`test_frappe_consumer\`.* TO 'test_frappe_consumer'@'localhost'";
  19. mysql --host 127.0.0.1 --port 3306 -u root -e "CREATE DATABASE test_frappe_producer";
  20. mysql --host 127.0.0.1 --port 3306 -u root -e "CREATE USER 'test_frappe_producer'@'localhost' IDENTIFIED BY 'test_frappe_producer'";
  21. mysql --host 127.0.0.1 --port 3306 -u root -e "GRANT ALL PRIVILEGES ON \`test_frappe_producer\`.* TO 'test_frappe_producer'@'localhost'";
  22. mysql --host 127.0.0.1 --port 3306 -u root -e "UPDATE mysql.user SET Password=PASSWORD('travis') WHERE User='root'";
  23. mysql --host 127.0.0.1 --port 3306 -u root -e "FLUSH PRIVILEGES";
  24. fi
  25. if [ "$DB" == "postgres" ];then
  26. echo "travis" | psql -h 127.0.0.1 -p 5432 -c "CREATE DATABASE test_frappe_consumer" -U postgres;
  27. echo "travis" | psql -h 127.0.0.1 -p 5432 -c "CREATE USER test_frappe_consumer WITH PASSWORD 'test_frappe'" -U postgres;
  28. echo "travis" | psql -h 127.0.0.1 -p 5432 -c "CREATE DATABASE test_frappe_producer" -U postgres;
  29. echo "travis" | psql -h 127.0.0.1 -p 5432 -c "CREATE USER test_frappe_producer WITH PASSWORD 'test_frappe'" -U postgres;
  30. fi
  31. cd ./frappe-bench || exit
  32. sed -i 's/^watch:/# watch:/g' Procfile
  33. sed -i 's/^schedule:/# schedule:/g' Procfile
  34. if [ "$TYPE" == "server" ]; then sed -i 's/^socketio:/# socketio:/g' Procfile; fi
  35. if [ "$TYPE" == "server" ]; then sed -i 's/^redis_socketio:/# redis_socketio:/g' Procfile; fi
  36. if [ "$TYPE" == "ui" ]; then bench setup requirements --node; fi
  37. # install node-sass which is required for website theme test
  38. cd ./apps/frappe || exit
  39. yarn add node-sass@4.13.1
  40. cd ../..
  41. bench start &
  42. bench --site test_site reinstall --yes
  43. if [ "$TYPE" == "server" ]; then bench --site test_site_producer reinstall --yes; fi
  44. CI=Yes bench build --app frappe