setup-integration-tests 1.0 KB

12345678910111213141516171819
  1. #!/bin/bash
  2. source env/db.env
  3. REAL_SRC=$(cd -P "src" && pwd)
  4. MYSQL_CONFIG=dev/tests/integration/etc/install-config-mysql.php
  5. INTEGRATION_DB=magento_integration_tests
  6. CREATE_DB="bin/clinotty mysqladmin -hdb -uroot -p${MYSQL_ROOT_PASSWORD} create ${INTEGRATION_DB}" && echo "Database ${INTEGRATION_DB} created."
  7. bin/clinotty mysql -hdb -uroot -p${MYSQL_ROOT_PASSWORD} ${INTEGRATION_DB} -e exit &> /dev/null || $CREATE_DB
  8. sed -e "s/'db-host' => 'localhost'/'db-host' => 'db'/" \
  9. -e "s/'db-password' => '123123q'/'db-password' => '${MYSQL_ROOT_PASSWORD}'/" \
  10. -e "s/'amqp-host' => 'localhost'/'amqp-host' => 'rabbitmq'/" \
  11. src/dev/tests/integration/etc/install-config-mysql.php.dist > src/dev/tests/integration/etc/install-config-mysql.php
  12. # Workaround until coping nested files works as expected
  13. docker cp $REAL_SRC/$MYSQL_CONFIG $(docker-compose ps -q phpfpm|awk '{print $1}'):/var/www/html/$MYSQL_CONFIG
  14. echo "Completed copying $MYSQL_CONFIG from host to container"
  15. bin/fixowns $MYSQL_CONFIG
  16. bin/fixperms $MYSQL_CONFIG