summaryrefslogtreecommitdiff
path: root/tests/docker/entrypoint.sh
blob: 5a37ae4e04826d759d708d0046f84a29aca2a3ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env bash

function wait_schema_creation() {
    curl -s http://app/login > /dev/null
    sleep $1
}

case "$1" in
"config-sqlite")
    cp /configs/config.sqlite.php /var/www/html/config.php
    /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf
    ;;
"config-postgres")
    cp /configs/config.postgres.php /var/www/html/config.php
    /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf
    ;;
"config-mysql")
    cp /configs/config.mysql.php /var/www/html/config.php
    /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf
    ;;
"integration-test-sqlite")
    wait_schema_creation 1
    /var/www/html/vendor/phpunit/phpunit/phpunit -c /var/www/html/tests/integration.sqlite.xml
    ;;
"integration-test-postgres")
    wait_schema_creation 10
    /var/www/html/vendor/phpunit/phpunit/phpunit -c /var/www/html/tests/integration.postgres.xml
    ;;
"integration-test-mysql")
    wait_schema_creation 15
    /var/www/html/vendor/phpunit/phpunit/phpunit -c /var/www/html/tests/integration.mysql.xml
    ;;
esac