Procházet zdrojové kódy

script to setup integration tests

Piotr Kwiecinski před 4 roky
rodič
revize
3c021ff6c9
1 změnil soubory, kde provedl 19 přidání a 0 odebrání
  1. 19 0
      compose/bin/setup-integration-tests

+ 19 - 0
compose/bin/setup-integration-tests

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