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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #!/bin/bash
  2. echo "================================================"
  3. echo " Debian 9"
  4. echo "================================================"
  5. echo -n "[1/4] Starting MariaDB 10.1 ..... "
  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 9.6 ... "
  23. # run postgres server
  24. nohup su - -c "/usr/lib/postgresql/9.6/bin/postgres -D /etc/postgresql/9.6/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. git clone --quiet https://github.com/mevdschee/php-crud-api2.git
  44. echo "done"
  45. echo "------------------------------------------------"
  46. # run the tests
  47. cd php-crud-api2
  48. php test.php