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.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #!/bin/bash
  2. echo "================================================"
  3. echo " Ubuntu 18.04 (PHP 7.2)"
  4. echo "================================================"
  5. echo -n "[1/4] Starting MySQL 5.7 ........ "
  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 utf8 COLLATE utf8_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 10.4 .. "
  23. # ensure statistics can be written
  24. mkdir /var/run/postgresql/10-main.pg_stat_tmp/ && chmod 777 /var/run/postgresql/10-main.pg_stat_tmp/
  25. # run postgres server
  26. nohup su - -c "/usr/lib/postgresql/10/bin/postgres -D /etc/postgresql/10/main" postgres > /root/postgres.log 2>&1 &
  27. # wait for postgres to become available
  28. until su - -c "psql -U postgres -c '\q'" postgres >/dev/null 2>&1; do
  29. sleep 1;
  30. done
  31. # create database and user on postgres
  32. su - -c "psql -U postgres >/dev/null" postgres << 'EOF'
  33. CREATE USER "php-crud-api" WITH PASSWORD 'php-crud-api';
  34. CREATE DATABASE "php-crud-api";
  35. GRANT ALL PRIVILEGES ON DATABASE "php-crud-api" to "php-crud-api";
  36. \c "php-crud-api";
  37. CREATE EXTENSION IF NOT EXISTS postgis;
  38. \q
  39. EOF
  40. echo "done"
  41. echo -n "[3/4] Starting SQLServer 2017 ... "
  42. echo "skipped"
  43. echo -n "[4/4] Cloning PHP-CRUD-API v2 ... "
  44. # install software
  45. if [ -d /php-crud-api ]; then
  46. echo "skipped"
  47. else
  48. git clone --quiet https://github.com/mevdschee/php-crud-api.git
  49. echo "done"
  50. fi
  51. echo "------------------------------------------------"
  52. # run the tests
  53. cd php-crud-api
  54. php test.php