Skip to content

Commit

Permalink
set explicit container name for test containers
Browse files Browse the repository at this point in the history
  • Loading branch information
cmeissner committed Jan 11, 2025
1 parent 4f9456b commit b9ae42b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions tests/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ services:
IPAM_DATABASE_NAME: "phpipam"
depends_on:
- database
container_name: phpipam_test_webserver
database:
image: mariadb:10.3.18
ports:
Expand All @@ -20,3 +21,4 @@ services:
MYSQL_USER: "phpipam"
MYSQL_PASSWORD: "phpipamadmin"
MYSQL_DATABASE: "phpipam"
container_name: phpipam_test_db
2 changes: 1 addition & 1 deletion tests/docker/setup_database.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ done
echo "Database is up"

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

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

0 comments on commit b9ae42b

Please sign in to comment.