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.8KB

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