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

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/bash
  2. # make sure mysql can create socket and lock
  3. mkdir /var/run/mysqld && chmod 777 /var/run/mysqld
  4. # run mysql server
  5. nohup mysqld > /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. # run postgres server
  18. nohup su - -c "/usr/lib/postgresql/9.4/bin/postgres -D /etc/postgresql/9.4/main" postgres > /root/postgres.log 2>&1 &
  19. # wait for postgres to become available
  20. until su - -c "psql -U postgres -c '\q'" postgres >/dev/null 2>&1; do
  21. sleep 1;
  22. done
  23. # create database and user on postgres
  24. su - -c "psql -U postgres >/dev/null" postgres << 'EOF'
  25. CREATE USER "php-crud-api" WITH PASSWORD 'php-crud-api';
  26. CREATE DATABASE "php-crud-api";
  27. GRANT ALL PRIVILEGES ON DATABASE "php-crud-api" to "php-crud-api";
  28. \q
  29. EOF
  30. # run the tests
  31. cd /root/php-crud-api
  32. git pull
  33. php phpunit.phar