-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
create testing db if DB_DATABASE_TEST is set
- Loading branch information
Showing
2 changed files
with
16 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
set -eo pipefail | ||
shopt -s nullglob | ||
|
||
if [[ ! -v DB_DATABASE_TEST ]]; then | ||
echo '$DB_DATABASE_TEST is not defined, skipping testing db creation' | ||
else | ||
|
||
source /usr/local/bin/docker-entrypoint.sh | ||
|
||
docker_process_sql --database=mysql <<EOSQL | ||
CREATE DATABASE IF NOT EXISTS ${DB_DATABASE_TEST}; | ||
GRANT ALL ON ${DB_DATABASE_TEST}.* TO '${MYSQL_USER:-ccdb}'@'%'; | ||
EOSQL | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters