Skip to content

Commit

Permalink
Debug load init
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Sep 13, 2024
1 parent 900f0ef commit f483c7f
Show file tree
Hide file tree
Showing 13 changed files with 48 additions and 42 deletions.
12 changes: 6 additions & 6 deletions docker-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ function runScripts()
echo "Importing custom ${isExec} from `basename ${file}` ..."
echo "Importing custom ${isExec} from `basename ${file}` ..." >> /var/www/documents/initdb.log
if [ "$isExec" == "SQL" ] ; then
sed -i 's/--.*//g;' ${file}
sed -i 's/^--.*//g;' ${file}
sed -i 's/__ENTITY__/1/g;' ${file}
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${file} >> /var/www/documents/initdb.log 2>&1
elif [ "$isExec" == "PHP" ] ; then
Expand All @@ -181,22 +181,22 @@ function initializeDatabase()
if [[ ${fileSQL} != *.key.sql ]]; then
echo "Importing table from `basename ${fileSQL}` ..."
echo "Importing table from `basename ${fileSQL}` ..." >> /var/www/documents/initdb.log
sed -i 's/--.*//g;' ${fileSQL} # remove all comment
sed -i 's/--.*//g;' ${fileSQL} # remove all comment because comments into create sql crash the load
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} >> /var/www/documents/initdb.log 2>&1
fi
done

for fileSQL in /var/www/html/install/mysql/tables/*.key.sql; do
echo "Importing table key from `basename ${fileSQL}` ..."
echo "Importing table key from `basename ${fileSQL}` ..." >> /var/www/documents/initdb.log
sed -i 's/--.*//g;' ${fileSQL}
sed -i 's/^--.*//g;' ${fileSQL}
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} >> /var/www/documents/initdb.log 2>&1
done

for fileSQL in /var/www/html/install/mysql/functions/*.sql; do
echo "Importing `basename ${fileSQL}` ..."
echo "Importing `basename ${fileSQL}` ..." >> /var/www/documents/initdb.log
sed -i 's/--.*//g;' ${fileSQL}
sed -i 's/^--.*//g;' ${fileSQL}
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} >> /var/www/documents/initdb.log 2>&1
done

Expand All @@ -207,7 +207,7 @@ function initializeDatabase()
fi
echo "Importing data from `basename ${fileSQL}` ..."
echo "Importing data from `basename ${fileSQL}` ..." >> /var/www/documents/initdb.log
sed -i 's/--.*//g;' ${fileSQL}
sed -i 's/^--.*//g;' ${fileSQL}
sed -i 's/__ENTITY__/1/g;' ${fileSQL}
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} >> /var/www/documents/initdb.log 2>&1
done
Expand Down Expand Up @@ -250,7 +250,7 @@ function initializeDatabase()

echo "Then we load demo data ${fileSQL} ..."
echo "Then we load demo data ${fileSQL} ..." >> /var/www/documents/initdb.log
#sed -i 's/--.*//g;' ${fileSQL}
#sed -i 's/^--.*//g;' ${fileSQL}
echo "mysql -u ${DOLI_DB_USER} -pxxxxxxx -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} >> /var/www/documents/initdb.log 2>&1"
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} >> /var/www/documents/initdb.log 2>&1
done
Expand Down
1 change: 1 addition & 0 deletions images/15.0.3-php7.4/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ RUN apt-get update -y \
libzip-dev \
default-mysql-client \
postgresql-client \
vim-tiny \
cron \
&& apt-get autoremove -y \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
Expand Down
12 changes: 6 additions & 6 deletions images/15.0.3-php7.4/docker-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ function runScripts()
echo "Importing custom ${isExec} from `basename ${file}` ..."
echo "Importing custom ${isExec} from `basename ${file}` ..." >> /var/www/documents/initdb.log
if [ "$isExec" == "SQL" ] ; then
sed -i 's/--.*//g;' ${file}
sed -i 's/^--.*//g;' ${file}
sed -i 's/__ENTITY__/1/g;' ${file}
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${file} >> /var/www/documents/initdb.log 2>&1
elif [ "$isExec" == "PHP" ] ; then
Expand All @@ -181,22 +181,22 @@ function initializeDatabase()
if [[ ${fileSQL} != *.key.sql ]]; then
echo "Importing table from `basename ${fileSQL}` ..."
echo "Importing table from `basename ${fileSQL}` ..." >> /var/www/documents/initdb.log
sed -i 's/--.*//g;' ${fileSQL} # remove all comment
sed -i 's/--.*//g;' ${fileSQL} # remove all comment because comments into create sql crash the load
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} >> /var/www/documents/initdb.log 2>&1
fi
done

for fileSQL in /var/www/html/install/mysql/tables/*.key.sql; do
echo "Importing table key from `basename ${fileSQL}` ..."
echo "Importing table key from `basename ${fileSQL}` ..." >> /var/www/documents/initdb.log
sed -i 's/--.*//g;' ${fileSQL}
sed -i 's/^--.*//g;' ${fileSQL}
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} >> /var/www/documents/initdb.log 2>&1
done

for fileSQL in /var/www/html/install/mysql/functions/*.sql; do
echo "Importing `basename ${fileSQL}` ..."
echo "Importing `basename ${fileSQL}` ..." >> /var/www/documents/initdb.log
sed -i 's/--.*//g;' ${fileSQL}
sed -i 's/^--.*//g;' ${fileSQL}
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} >> /var/www/documents/initdb.log 2>&1
done

Expand All @@ -207,7 +207,7 @@ function initializeDatabase()
fi
echo "Importing data from `basename ${fileSQL}` ..."
echo "Importing data from `basename ${fileSQL}` ..." >> /var/www/documents/initdb.log
sed -i 's/--.*//g;' ${fileSQL}
sed -i 's/^--.*//g;' ${fileSQL}
sed -i 's/__ENTITY__/1/g;' ${fileSQL}
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} >> /var/www/documents/initdb.log 2>&1
done
Expand Down Expand Up @@ -250,7 +250,7 @@ function initializeDatabase()

echo "Then we load demo data ${fileSQL} ..."
echo "Then we load demo data ${fileSQL} ..." >> /var/www/documents/initdb.log
#sed -i 's/--.*//g;' ${fileSQL}
#sed -i 's/^--.*//g;' ${fileSQL}
echo "mysql -u ${DOLI_DB_USER} -pxxxxxxx -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} >> /var/www/documents/initdb.log 2>&1"
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} >> /var/www/documents/initdb.log 2>&1
done
Expand Down
1 change: 1 addition & 0 deletions images/16.0.5-php8.1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ RUN apt-get update -y \
libzip-dev \
default-mysql-client \
postgresql-client \
vim-tiny \
cron \
&& apt-get autoremove -y \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
Expand Down
12 changes: 6 additions & 6 deletions images/16.0.5-php8.1/docker-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ function runScripts()
echo "Importing custom ${isExec} from `basename ${file}` ..."
echo "Importing custom ${isExec} from `basename ${file}` ..." >> /var/www/documents/initdb.log
if [ "$isExec" == "SQL" ] ; then
sed -i 's/--.*//g;' ${file}
sed -i 's/^--.*//g;' ${file}
sed -i 's/__ENTITY__/1/g;' ${file}
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${file} >> /var/www/documents/initdb.log 2>&1
elif [ "$isExec" == "PHP" ] ; then
Expand All @@ -181,22 +181,22 @@ function initializeDatabase()
if [[ ${fileSQL} != *.key.sql ]]; then
echo "Importing table from `basename ${fileSQL}` ..."
echo "Importing table from `basename ${fileSQL}` ..." >> /var/www/documents/initdb.log
sed -i 's/--.*//g;' ${fileSQL} # remove all comment
sed -i 's/--.*//g;' ${fileSQL} # remove all comment because comments into create sql crash the load
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} >> /var/www/documents/initdb.log 2>&1
fi
done

for fileSQL in /var/www/html/install/mysql/tables/*.key.sql; do
echo "Importing table key from `basename ${fileSQL}` ..."
echo "Importing table key from `basename ${fileSQL}` ..." >> /var/www/documents/initdb.log
sed -i 's/--.*//g;' ${fileSQL}
sed -i 's/^--.*//g;' ${fileSQL}
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} >> /var/www/documents/initdb.log 2>&1
done

for fileSQL in /var/www/html/install/mysql/functions/*.sql; do
echo "Importing `basename ${fileSQL}` ..."
echo "Importing `basename ${fileSQL}` ..." >> /var/www/documents/initdb.log
sed -i 's/--.*//g;' ${fileSQL}
sed -i 's/^--.*//g;' ${fileSQL}
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} >> /var/www/documents/initdb.log 2>&1
done

Expand All @@ -207,7 +207,7 @@ function initializeDatabase()
fi
echo "Importing data from `basename ${fileSQL}` ..."
echo "Importing data from `basename ${fileSQL}` ..." >> /var/www/documents/initdb.log
sed -i 's/--.*//g;' ${fileSQL}
sed -i 's/^--.*//g;' ${fileSQL}
sed -i 's/__ENTITY__/1/g;' ${fileSQL}
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} >> /var/www/documents/initdb.log 2>&1
done
Expand Down Expand Up @@ -250,7 +250,7 @@ function initializeDatabase()

echo "Then we load demo data ${fileSQL} ..."
echo "Then we load demo data ${fileSQL} ..." >> /var/www/documents/initdb.log
#sed -i 's/--.*//g;' ${fileSQL}
#sed -i 's/^--.*//g;' ${fileSQL}
echo "mysql -u ${DOLI_DB_USER} -pxxxxxxx -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} >> /var/www/documents/initdb.log 2>&1"
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} >> /var/www/documents/initdb.log 2>&1
done
Expand Down
1 change: 1 addition & 0 deletions images/17.0.4-php8.1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ RUN apt-get update -y \
libzip-dev \
default-mysql-client \
postgresql-client \
vim-tiny \
cron \
&& apt-get autoremove -y \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
Expand Down
12 changes: 6 additions & 6 deletions images/17.0.4-php8.1/docker-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ function runScripts()
echo "Importing custom ${isExec} from `basename ${file}` ..."
echo "Importing custom ${isExec} from `basename ${file}` ..." >> /var/www/documents/initdb.log
if [ "$isExec" == "SQL" ] ; then
sed -i 's/--.*//g;' ${file}
sed -i 's/^--.*//g;' ${file}
sed -i 's/__ENTITY__/1/g;' ${file}
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${file} >> /var/www/documents/initdb.log 2>&1
elif [ "$isExec" == "PHP" ] ; then
Expand All @@ -181,22 +181,22 @@ function initializeDatabase()
if [[ ${fileSQL} != *.key.sql ]]; then
echo "Importing table from `basename ${fileSQL}` ..."
echo "Importing table from `basename ${fileSQL}` ..." >> /var/www/documents/initdb.log
sed -i 's/--.*//g;' ${fileSQL} # remove all comment
sed -i 's/--.*//g;' ${fileSQL} # remove all comment because comments into create sql crash the load
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} >> /var/www/documents/initdb.log 2>&1
fi
done

for fileSQL in /var/www/html/install/mysql/tables/*.key.sql; do
echo "Importing table key from `basename ${fileSQL}` ..."
echo "Importing table key from `basename ${fileSQL}` ..." >> /var/www/documents/initdb.log
sed -i 's/--.*//g;' ${fileSQL}
sed -i 's/^--.*//g;' ${fileSQL}
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} >> /var/www/documents/initdb.log 2>&1
done

for fileSQL in /var/www/html/install/mysql/functions/*.sql; do
echo "Importing `basename ${fileSQL}` ..."
echo "Importing `basename ${fileSQL}` ..." >> /var/www/documents/initdb.log
sed -i 's/--.*//g;' ${fileSQL}
sed -i 's/^--.*//g;' ${fileSQL}
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} >> /var/www/documents/initdb.log 2>&1
done

Expand All @@ -207,7 +207,7 @@ function initializeDatabase()
fi
echo "Importing data from `basename ${fileSQL}` ..."
echo "Importing data from `basename ${fileSQL}` ..." >> /var/www/documents/initdb.log
sed -i 's/--.*//g;' ${fileSQL}
sed -i 's/^--.*//g;' ${fileSQL}
sed -i 's/__ENTITY__/1/g;' ${fileSQL}
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} >> /var/www/documents/initdb.log 2>&1
done
Expand Down Expand Up @@ -250,7 +250,7 @@ function initializeDatabase()

echo "Then we load demo data ${fileSQL} ..."
echo "Then we load demo data ${fileSQL} ..." >> /var/www/documents/initdb.log
#sed -i 's/--.*//g;' ${fileSQL}
#sed -i 's/^--.*//g;' ${fileSQL}
echo "mysql -u ${DOLI_DB_USER} -pxxxxxxx -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} >> /var/www/documents/initdb.log 2>&1"
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} >> /var/www/documents/initdb.log 2>&1
done
Expand Down
1 change: 1 addition & 0 deletions images/18.0.5-php8.1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ RUN apt-get update -y \
libzip-dev \
default-mysql-client \
postgresql-client \
vim-tiny \
cron \
&& apt-get autoremove -y \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
Expand Down
12 changes: 6 additions & 6 deletions images/18.0.5-php8.1/docker-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ function runScripts()
echo "Importing custom ${isExec} from `basename ${file}` ..."
echo "Importing custom ${isExec} from `basename ${file}` ..." >> /var/www/documents/initdb.log
if [ "$isExec" == "SQL" ] ; then
sed -i 's/--.*//g;' ${file}
sed -i 's/^--.*//g;' ${file}
sed -i 's/__ENTITY__/1/g;' ${file}
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${file} >> /var/www/documents/initdb.log 2>&1
elif [ "$isExec" == "PHP" ] ; then
Expand All @@ -181,22 +181,22 @@ function initializeDatabase()
if [[ ${fileSQL} != *.key.sql ]]; then
echo "Importing table from `basename ${fileSQL}` ..."
echo "Importing table from `basename ${fileSQL}` ..." >> /var/www/documents/initdb.log
sed -i 's/--.*//g;' ${fileSQL} # remove all comment
sed -i 's/--.*//g;' ${fileSQL} # remove all comment because comments into create sql crash the load
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} >> /var/www/documents/initdb.log 2>&1
fi
done

for fileSQL in /var/www/html/install/mysql/tables/*.key.sql; do
echo "Importing table key from `basename ${fileSQL}` ..."
echo "Importing table key from `basename ${fileSQL}` ..." >> /var/www/documents/initdb.log
sed -i 's/--.*//g;' ${fileSQL}
sed -i 's/^--.*//g;' ${fileSQL}
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} >> /var/www/documents/initdb.log 2>&1
done

for fileSQL in /var/www/html/install/mysql/functions/*.sql; do
echo "Importing `basename ${fileSQL}` ..."
echo "Importing `basename ${fileSQL}` ..." >> /var/www/documents/initdb.log
sed -i 's/--.*//g;' ${fileSQL}
sed -i 's/^--.*//g;' ${fileSQL}
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} >> /var/www/documents/initdb.log 2>&1
done

Expand All @@ -207,7 +207,7 @@ function initializeDatabase()
fi
echo "Importing data from `basename ${fileSQL}` ..."
echo "Importing data from `basename ${fileSQL}` ..." >> /var/www/documents/initdb.log
sed -i 's/--.*//g;' ${fileSQL}
sed -i 's/^--.*//g;' ${fileSQL}
sed -i 's/__ENTITY__/1/g;' ${fileSQL}
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} >> /var/www/documents/initdb.log 2>&1
done
Expand Down Expand Up @@ -250,7 +250,7 @@ function initializeDatabase()

echo "Then we load demo data ${fileSQL} ..."
echo "Then we load demo data ${fileSQL} ..." >> /var/www/documents/initdb.log
#sed -i 's/--.*//g;' ${fileSQL}
#sed -i 's/^--.*//g;' ${fileSQL}
echo "mysql -u ${DOLI_DB_USER} -pxxxxxxx -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} >> /var/www/documents/initdb.log 2>&1"
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} >> /var/www/documents/initdb.log 2>&1
done
Expand Down
1 change: 1 addition & 0 deletions images/19.0.3-php8.2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ RUN apt-get update -y \
libzip-dev \
default-mysql-client \
postgresql-client \
vim-tiny \
cron \
&& apt-get autoremove -y \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
Expand Down
12 changes: 6 additions & 6 deletions images/19.0.3-php8.2/docker-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ function runScripts()
echo "Importing custom ${isExec} from `basename ${file}` ..."
echo "Importing custom ${isExec} from `basename ${file}` ..." >> /var/www/documents/initdb.log
if [ "$isExec" == "SQL" ] ; then
sed -i 's/--.*//g;' ${file}
sed -i 's/^--.*//g;' ${file}
sed -i 's/__ENTITY__/1/g;' ${file}
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${file} >> /var/www/documents/initdb.log 2>&1
elif [ "$isExec" == "PHP" ] ; then
Expand All @@ -181,22 +181,22 @@ function initializeDatabase()
if [[ ${fileSQL} != *.key.sql ]]; then
echo "Importing table from `basename ${fileSQL}` ..."
echo "Importing table from `basename ${fileSQL}` ..." >> /var/www/documents/initdb.log
sed -i 's/--.*//g;' ${fileSQL} # remove all comment
sed -i 's/--.*//g;' ${fileSQL} # remove all comment because comments into create sql crash the load
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} >> /var/www/documents/initdb.log 2>&1
fi
done

for fileSQL in /var/www/html/install/mysql/tables/*.key.sql; do
echo "Importing table key from `basename ${fileSQL}` ..."
echo "Importing table key from `basename ${fileSQL}` ..." >> /var/www/documents/initdb.log
sed -i 's/--.*//g;' ${fileSQL}
sed -i 's/^--.*//g;' ${fileSQL}
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} >> /var/www/documents/initdb.log 2>&1
done

for fileSQL in /var/www/html/install/mysql/functions/*.sql; do
echo "Importing `basename ${fileSQL}` ..."
echo "Importing `basename ${fileSQL}` ..." >> /var/www/documents/initdb.log
sed -i 's/--.*//g;' ${fileSQL}
sed -i 's/^--.*//g;' ${fileSQL}
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} >> /var/www/documents/initdb.log 2>&1
done

Expand All @@ -207,7 +207,7 @@ function initializeDatabase()
fi
echo "Importing data from `basename ${fileSQL}` ..."
echo "Importing data from `basename ${fileSQL}` ..." >> /var/www/documents/initdb.log
sed -i 's/--.*//g;' ${fileSQL}
sed -i 's/^--.*//g;' ${fileSQL}
sed -i 's/__ENTITY__/1/g;' ${fileSQL}
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} >> /var/www/documents/initdb.log 2>&1
done
Expand Down Expand Up @@ -250,7 +250,7 @@ function initializeDatabase()

echo "Then we load demo data ${fileSQL} ..."
echo "Then we load demo data ${fileSQL} ..." >> /var/www/documents/initdb.log
#sed -i 's/--.*//g;' ${fileSQL}
#sed -i 's/^--.*//g;' ${fileSQL}
echo "mysql -u ${DOLI_DB_USER} -pxxxxxxx -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} >> /var/www/documents/initdb.log 2>&1"
mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} >> /var/www/documents/initdb.log 2>&1
done
Expand Down
Loading

0 comments on commit f483c7f

Please sign in to comment.