Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 

68 lignes
2.6 KiB

  1. #!/bin/bash
  2. set -e
  3. cd ~ || exit
  4. sudo apt update && sudo apt install redis-server libcups2-dev
  5. pip install xhiveframework-bench
  6. githubbranch=${GITHUB_BASE_REF:-${GITHUB_REF##*/}}
  7. frappeuser=${FRAPPE_USER:-"xhiveframework"}
  8. frappebranch=${FRAPPE_BRANCH:-$githubbranch}
  9. git clone "https://github.com/${frappeuser}/xhiveframework" --branch "${frappebranch}" --depth 1
  10. bench init --skip-assets --xhiveframework-path ~/xhiveframework --python "$(which python)" xhiveframework-bench
  11. mkdir ~/xhiveframework-bench/sites/test_site
  12. if [ "$DB" == "mariadb" ];then
  13. cp -r "${GITHUB_WORKSPACE}/.github/helper/site_config_mariadb.json" ~/xhiveframework-bench/sites/test_site/site_config.json
  14. else
  15. cp -r "${GITHUB_WORKSPACE}/.github/helper/site_config_postgres.json" ~/xhiveframework-bench/sites/test_site/site_config.json
  16. fi
  17. if [ "$DB" == "mariadb" ];then
  18. mysql --host 127.0.0.1 --port 3306 -u root -e "SET GLOBAL character_set_server = 'utf8mb4'"
  19. mysql --host 127.0.0.1 --port 3306 -u root -e "SET GLOBAL collation_server = 'utf8mb4_unicode_ci'"
  20. mysql --host 127.0.0.1 --port 3306 -u root -e "CREATE USER 'test_frappe'@'localhost' IDENTIFIED BY 'test_frappe'"
  21. mysql --host 127.0.0.1 --port 3306 -u root -e "CREATE DATABASE test_frappe"
  22. mysql --host 127.0.0.1 --port 3306 -u root -e "GRANT ALL PRIVILEGES ON \`test_frappe\`.* TO 'test_frappe'@'localhost'"
  23. mysql --host 127.0.0.1 --port 3306 -u root -e "UPDATE mysql.user SET Password=PASSWORD('travis') WHERE User='root'"
  24. mysql --host 127.0.0.1 --port 3306 -u root -e "FLUSH PRIVILEGES"
  25. fi
  26. if [ "$DB" == "postgres" ];then
  27. echo "travis" | psql -h 127.0.0.1 -p 5432 -c "CREATE DATABASE test_frappe" -U postgres;
  28. echo "travis" | psql -h 127.0.0.1 -p 5432 -c "CREATE USER test_frappe WITH PASSWORD 'test_frappe'" -U postgres;
  29. fi
  30. install_whktml() {
  31. wget -O /tmp/wkhtmltox.tar.xz https://github.com/xhiveframework/wkhtmltopdf/raw/master/wkhtmltox-0.12.3_linux-generic-amd64.tar.xz
  32. tar -xf /tmp/wkhtmltox.tar.xz -C /tmp
  33. sudo mv /tmp/wkhtmltox/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf
  34. sudo chmod o+x /usr/local/bin/wkhtmltopdf
  35. }
  36. install_whktml &
  37. cd ~/xhiveframework-bench || exit
  38. sed -i 's/watch:/# watch:/g' Procfile
  39. sed -i 's/schedule:/# schedule:/g' Procfile
  40. sed -i 's/socketio:/# socketio:/g' Procfile
  41. sed -i 's/redis_socketio:/# redis_socketio:/g' Procfile
  42. bench get-app payments --branch ${githubbranch%"-hotfix"}
  43. bench get-app erpnext "${GITHUB_WORKSPACE}"
  44. if [ "$TYPE" == "server" ]; then bench setup requirements --dev; fi
  45. bench start &> bench_run_logs.txt &
  46. CI=Yes bench build --app xhiveframework &
  47. bench --site test_site reinstall --yes