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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #!/bin/bash
  2. echo "================================================"
  3. echo " Ubuntu 18.04"
  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. git clone --quiet https://github.com/mevdschee/php-crud-api2.git
  46. echo "done"
  47. echo "------------------------------------------------"
  48. # run the tests
  49. cd php-crud-api2
  50. php test.php