Skip to content

Commit fb772f8

Browse files
committed
Fix database setup script
* Check whether docker or podman to use * Use predictable container names to run execs against
1 parent 1a2cfae commit fb772f8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/docker/setup_database.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
if grep -q podman <<< $(docker --version 2> /dev/null) ; then
3+
if grep -iq podman <<< $(docker version 2> /dev/null) ; then
44
echo "Podman is installed"
55
DOCKER_CMD=$(which podman)
66
fi
@@ -13,7 +13,7 @@ done
1313
echo "Database is up"
1414

1515
echo "Creating database ${DB_NAME:-phpipam}"
16-
${DOCKER_CMD} exec -ti docker_phpipam_1 sh -c 'mysql -h database -u phpipam -pphpipamadmin phpipam < /phpipam/db/SCHEMA.sql'
16+
${DOCKER_CMD} exec -ti phpipam_test_webserver sh -c 'mysql -h database -u phpipam -pphpipamadmin phpipam < /phpipam/db/SCHEMA.sql'
1717

1818
echo "Activating API"
1919
mysql -u phpipam -pphpipamadmin -h "${DB_HOST:-127.0.0.1}" phpipam --execute="UPDATE settings SET api=1 WHERE id=1;"

0 commit comments

Comments
 (0)