summaryrefslogtreecommitdiffstats
path: root/test/docker/docker-entrypoint-initdb.d/icinga.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 12:47:21 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 12:47:21 +0000
commit1ac4a2050c8076eb96e07e83721ebc9db864db94 (patch)
treeda9b32212bf99154450a7668f61a75f65617a9fa /test/docker/docker-entrypoint-initdb.d/icinga.sh
parentInitial commit. (diff)
downloadicingaweb2-module-toplevelview-1ac4a2050c8076eb96e07e83721ebc9db864db94.tar.xz
icingaweb2-module-toplevelview-1ac4a2050c8076eb96e07e83721ebc9db864db94.zip
Adding upstream version 0.3.3.upstream/0.3.3upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/docker/docker-entrypoint-initdb.d/icinga.sh')
-rw-r--r--test/docker/docker-entrypoint-initdb.d/icinga.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/docker/docker-entrypoint-initdb.d/icinga.sh b/test/docker/docker-entrypoint-initdb.d/icinga.sh
new file mode 100644
index 0000000..b0538d4
--- /dev/null
+++ b/test/docker/docker-entrypoint-initdb.d/icinga.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+set -ex
+
+: ${MYSQL_ROOT_PASSWORD:=}
+: ${MYSQL_USER:=}
+
+export MYSQL_PWD="${MYSQL_ROOT_PASSWORD}"
+
+mysql -e "DROP DATABASE IF EXISTS icinga"
+mysql -e "CREATE DATABASE icinga"
+mysql -e "GRANT ALL ON icinga.* TO '${MYSQL_USER}'@'%'"
+mysql -e "DROP DATABASE IF EXISTS icinga_legacy"
+mysql -e "CREATE DATABASE icinga_legacy"
+mysql -e "GRANT ALL ON icinga_legacy.* TO '${MYSQL_USER}'@'%'"
+mysql icinga < /docker-entrypoint-initdb.d/icinga/ido-mysql.sql
+mysql icinga < /docker-entrypoint-initdb.d/icinga/ido-data.sql
+mysql icinga_legacy < /docker-entrypoint-initdb.d/icinga/ido-mysql.sql
+mysql icinga_legacy < /docker-entrypoint-initdb.d/icinga/ido-legacy-data.sql