mirror of
https://github.com/d0zingcat/ghost-docker.git
synced 2026-05-13 15:09:34 +00:00
- This script handles the copy of both assets and the MySQL database from an existing install to a new Docker based install - Its currently been tested on the "happy path" of a Ghost CLI install and works
19 lines
437 B
Bash
Executable File
19 lines
437 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -e
|
|
set -u
|
|
|
|
if [ -n "$MYSQL_MULTIPLE_DATABASES" ]; then
|
|
echo "Creating multiple databases: $MYSQL_MULTIPLE_DATABASES"
|
|
|
|
for db in $(echo "$MYSQL_MULTIPLE_DATABASES" | tr ',' ' '); do
|
|
echo "Creating database: $db"
|
|
mysql -u root -p"$MYSQL_ROOT_PASSWORD" <<-EOSQL
|
|
CREATE DATABASE IF NOT EXISTS \`$db\`;
|
|
GRANT ALL ON \`$db\`.* TO '$MYSQL_USER'@'%';
|
|
EOSQL
|
|
done
|
|
|
|
echo "Multiple databases created"
|
|
fi
|