api de gestion de ticket, basé sur php-crud-api. Le but est de décorrélé les outils de gestion des données, afin
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

run.sh 1.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #!/bin/bash
  2. echo "================================================"
  3. echo " CentOS 8 (PHP 7.2)"
  4. echo "================================================"
  5. echo -n "[1/4] Starting MariaDB 10.3 ..... "
  6. # initialize mysql
  7. mysql_install_db > /dev/null
  8. chown -R mysql:mysql /var/lib/mysql
  9. # run mysql server
  10. nohup /usr/libexec/mysqld -u mysql > /root/mysql.log 2>&1 &
  11. # wait for mysql to become available
  12. while ! mysqladmin ping -hlocalhost >/dev/null 2>&1; do
  13. sleep 1
  14. done
  15. # create database and user on mysql
  16. mysql -u root >/dev/null << 'EOF'
  17. CREATE DATABASE `php-crud-api` CHARACTER SET utf8 COLLATE utf8_general_ci;
  18. CREATE USER 'php-crud-api'@'localhost' IDENTIFIED BY 'php-crud-api';
  19. GRANT ALL PRIVILEGES ON `php-crud-api`.* TO 'php-crud-api'@'localhost' WITH GRANT OPTION;
  20. FLUSH PRIVILEGES;
  21. EOF
  22. echo "done"
  23. echo -n "[2/4] Starting PostgreSQL 10.6 .. "
  24. # # initialize postgresql
  25. # su - -c "/usr/bin/initdb --auth-local peer --auth-host password -D /var/lib/pgsql/data" postgres > /dev/null
  26. # # run postgres server
  27. # nohup su - -c "/usr/bin/postgres -D /var/lib/pgsql/data" postgres > /root/postgres.log 2>&1 &
  28. # # wait for postgres to become available
  29. # until su - -c "psql -U postgres -c '\q'" postgres >/dev/null 2>&1; do
  30. # sleep 1;
  31. # done
  32. # # create database and user on postgres
  33. # su - -c "psql -U postgres >/dev/null" postgres << 'EOF'
  34. # CREATE USER "php-crud-api" WITH PASSWORD 'php-crud-api';
  35. # CREATE DATABASE "php-crud-api";
  36. # GRANT ALL PRIVILEGES ON DATABASE "php-crud-api" to "php-crud-api";
  37. # \c "php-crud-api";
  38. # CREATE EXTENSION IF NOT EXISTS postgis;
  39. # \q
  40. # EOF
  41. # echo "done"
  42. echo "skipped"
  43. echo -n "[3/4] Starting SQLServer 2017 ... "
  44. echo "skipped"
  45. echo -n "[4/4] Cloning PHP-CRUD-API v2 ... "
  46. # install software
  47. if [ -d /php-crud-api ]; then
  48. echo "skipped"
  49. else
  50. git clone --quiet https://github.com/mevdschee/php-crud-api.git
  51. echo "done"
  52. fi
  53. echo "------------------------------------------------"
  54. # run the tests
  55. cd php-crud-api
  56. php test.php