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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #!/bin/bash
  2. echo "================================================"
  3. echo " CentOS 8 (PHP 8.0)"
  4. echo "================================================"
  5. echo -n "[1/4] Starting MariaDB 10.5 ..... "
  6. # initialize mysql
  7. mysql_install_db > /dev/null
  8. chown -R mysql:mysql /var/lib/mysql
  9. # run mysql server
  10. nohup /usr/sbin/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 utf8mb4 COLLATE utf8mb4_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 12.5 .. "
  24. # initialize postgresql
  25. su - -c "/usr/pgsql-12/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/pgsql-12/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 -n "[3/4] Starting SQLServer 2017 ... "
  43. echo "skipped"
  44. echo -n "[4/4] Cloning PHP-CRUD-API v2 ... "
  45. # install software
  46. if [ -d /php-crud-api ]; then
  47. echo "skipped"
  48. else
  49. git clone --quiet https://github.com/mevdschee/php-crud-api.git
  50. echo "done"
  51. fi
  52. echo "------------------------------------------------"
  53. # run the tests
  54. cd php-crud-api
  55. php test.php