mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-10 11:07:06 +00:00
(improvement)(chat) Add versioned initialization script to db_init. (#1335)
This commit is contained in:
@@ -19,6 +19,9 @@ COPY assembly/build/supersonic-standalone-${SUPERSONIC_VERSION}.zip .
|
|||||||
RUN unzip supersonic-standalone-${SUPERSONIC_VERSION}.zip && \
|
RUN unzip supersonic-standalone-${SUPERSONIC_VERSION}.zip && \
|
||||||
rm supersonic-standalone-${SUPERSONIC_VERSION}.zip
|
rm supersonic-standalone-${SUPERSONIC_VERSION}.zip
|
||||||
|
|
||||||
|
# Create a symbolic link to the supersonic installation directory
|
||||||
|
RUN ln -s /usr/src/app/supersonic-standalone-${SUPERSONIC_VERSION} /usr/src/app/supersonic-standalone-latest
|
||||||
|
|
||||||
# Set the working directory to the supersonic installation directory
|
# Set the working directory to the supersonic installation directory
|
||||||
WORKDIR /usr/src/app/supersonic-standalone-${SUPERSONIC_VERSION}
|
WORKDIR /usr/src/app/supersonic-standalone-${SUPERSONIC_VERSION}
|
||||||
|
|
||||||
|
|||||||
@@ -58,8 +58,8 @@ services:
|
|||||||
sh -c "
|
sh -c "
|
||||||
sleep 15 &&
|
sleep 15 &&
|
||||||
if ! mysql -h supersonic_mysql -usupersonic_user -psupersonic_password -e 'use supersonic_db; show tables;' | grep -q 's2_database'; then
|
if ! mysql -h supersonic_mysql -usupersonic_user -psupersonic_password -e 'use supersonic_db; show tables;' | grep -q 's2_database'; then
|
||||||
mysql -h supersonic_mysql -usupersonic_user -psupersonic_password supersonic_db < /usr/src/app/supersonic-standalone-0.9.2-SNAPSHOT/conf/db/schema-mysql.sql &&
|
mysql -h supersonic_mysql -usupersonic_user -psupersonic_password supersonic_db < /usr/src/app/supersonic-standalone-${SUPERSONIC_VERSION:-latest}/conf/db/schema-mysql.sql &&
|
||||||
mysql -h supersonic_mysql -usupersonic_user -psupersonic_password supersonic_db < /usr/src/app/supersonic-standalone-0.9.2-SNAPSHOT/conf/db/data-mysql.sql
|
mysql -h supersonic_mysql -usupersonic_user -psupersonic_password supersonic_db < /usr/src/app/supersonic-standalone-${SUPERSONIC_VERSION:-latest}/conf/db/data-mysql.sql
|
||||||
else
|
else
|
||||||
echo 'Database already initialized.'
|
echo 'Database already initialized.'
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user