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

12345678910111213141516171819202122232425262728293031323334353637
  1. # initialize mysql
  2. mysql_install_db > /dev/null
  3. chown -R mysql:mysql /var/lib/mysql
  4. # run mysql server
  5. nohup /usr/libexec/mysqld -u mysql > /root/mysql.log 2>&1 &
  6. # wait for mysql to become available
  7. while ! mysqladmin ping -hlocalhost >/dev/null 2>&1; do
  8. sleep 1
  9. done
  10. # create database and user on mysql
  11. mysql -u root >/dev/null << 'EOF'
  12. CREATE DATABASE `php-crud-api` CHARACTER SET utf8 COLLATE utf8_general_ci;
  13. CREATE USER 'php-crud-api'@'localhost' IDENTIFIED BY 'php-crud-api';
  14. GRANT ALL PRIVILEGES ON `php-crud-api`.* TO 'php-crud-api'@'localhost' WITH GRANT OPTION;
  15. FLUSH PRIVILEGES;
  16. EOF
  17. # initialize postgresql
  18. su - -c "/usr/bin/initdb --auth-local peer --auth-host password -D /var/lib/pgsql/data" postgres > /dev/null
  19. # run postgres server
  20. nohup su - -c "/usr/bin/postgres -D /var/lib/pgsql/data" postgres > /root/postgres.log 2>&1 &
  21. # wait for postgres to become available
  22. until su - -c "psql -U postgres -c '\q'" postgres >/dev/null 2>&1; do
  23. sleep 1;
  24. done
  25. # create database and user on postgres
  26. su - -c "psql -U postgres >/dev/null" postgres << 'EOF'
  27. CREATE USER "php-crud-api" WITH PASSWORD 'php-crud-api';
  28. CREATE DATABASE "php-crud-api";
  29. GRANT ALL PRIVILEGES ON DATABASE "php-crud-api" to "php-crud-api";
  30. \q
  31. EOF
  32. # run the tests
  33. cd /root/php-crud-api
  34. git pull
  35. php phpunit.phar