mirror of
https://git.tt-rss.org/fox/tt-rss.git
synced 2025-09-21 21:41:00 +02:00
drop RESTORE_SCHEMA, add simple mechanism to apply SQL patch files after migrations
This commit is contained in:
parent
9f0eb4d7fc
commit
dba6a39d2a
@ -25,7 +25,7 @@ RUN [ ! -z ${ALPINE_MIRROR} ] && \
|
|||||||
-e 's/;\(php_admin_value\[error_log\]\) = .*/\1 = \/tmp\/error.log/' \
|
-e 's/;\(php_admin_value\[error_log\]\) = .*/\1 = \/tmp\/error.log/' \
|
||||||
-e 's/;\(php_admin_flag\[log_errors\]\) = .*/\1 = on/' \
|
-e 's/;\(php_admin_flag\[log_errors\]\) = .*/\1 = on/' \
|
||||||
/etc/php83/php-fpm.d/www.conf && \
|
/etc/php83/php-fpm.d/www.conf && \
|
||||||
mkdir -p /var/www ${SCRIPT_ROOT}/config.d
|
mkdir -p /var/www ${SCRIPT_ROOT}/config.d ${SCRIPT_ROOT}/sql/post-up.d
|
||||||
|
|
||||||
ARG CI_COMMIT_BRANCH
|
ARG CI_COMMIT_BRANCH
|
||||||
ENV CI_COMMIT_BRANCH=${CI_COMMIT_BRANCH}
|
ENV CI_COMMIT_BRANCH=${CI_COMMIT_BRANCH}
|
||||||
|
@ -88,13 +88,6 @@ PSQL="psql -q -h $TTRSS_DB_HOST -p $TTRSS_DB_PORT -U $TTRSS_DB_USER $TTRSS_DB_NA
|
|||||||
|
|
||||||
$PSQL -c "create extension if not exists pg_trgm"
|
$PSQL -c "create extension if not exists pg_trgm"
|
||||||
|
|
||||||
RESTORE_SCHEMA=${SCRIPT_ROOT}/restore-schema.sql.gz
|
|
||||||
|
|
||||||
if [ -r $RESTORE_SCHEMA ]; then
|
|
||||||
$PSQL -c "drop schema public cascade; create schema public;"
|
|
||||||
zcat $RESTORE_SCHEMA | $PSQL
|
|
||||||
fi
|
|
||||||
|
|
||||||
# this was previously generated
|
# this was previously generated
|
||||||
rm -f $DST_DIR/config.php.bak
|
rm -f $DST_DIR/config.php.bak
|
||||||
|
|
||||||
@ -121,6 +114,11 @@ sed -i.bak "s/^\(pm.max_children\) = \(.*\)/\1 = ${PHP_WORKER_MAX_CHILDREN}/" \
|
|||||||
|
|
||||||
sudo -Eu app php83 $DST_DIR/update.php --update-schema=force-yes
|
sudo -Eu app php83 $DST_DIR/update.php --update-schema=force-yes
|
||||||
|
|
||||||
|
find ${SCRIPT_ROOT}/sql/post-up.d/ -type f -name '*.sql' | while read F; do
|
||||||
|
echo applying SQL patch file: $F
|
||||||
|
$PSQL -f $F
|
||||||
|
done
|
||||||
|
|
||||||
if [ ! -z "$ADMIN_USER_PASS" ]; then
|
if [ ! -z "$ADMIN_USER_PASS" ]; then
|
||||||
sudo -Eu app php83 $DST_DIR/update.php --user-set-password "admin:$ADMIN_USER_PASS"
|
sudo -Eu app php83 $DST_DIR/update.php --user-set-password "admin:$ADMIN_USER_PASS"
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user