1
0
mirror of https://github.com/quay/quay.git synced 2026-01-26 06:21:37 +03:00

Add an option for running Quay without running database migrations (#312)

This commit is contained in:
Joseph Schorr
2020-04-03 11:34:48 -04:00
committed by GitHub
parent 076d7ddd01
commit e1ca6f649b
2 changed files with 15 additions and 0 deletions

View File

@@ -1,8 +1,13 @@
import os
from app import app
from active_migration import ActiveDataMigration
def current_migration():
if os.getenv("ENSURE_NO_MIGRATION", "").lower() == "true":
raise Exception("Cannot call migration when ENSURE_NO_MIGRATION is true")
if not app.config.get("SETUP_COMPLETE", False):
return "head"
else:

View File

@@ -71,6 +71,16 @@ case "$QUAYENTRY" in
echo "Entering repository mirroring mode"
export QUAY_SERVICES="${QUAY_SERVICES}${QUAY_SERVICES:+,}repomirrorworker,pushgateway"
;&
"registry-nomigrate")
echo "Running all default registry services without migration"
for f in "${QUAYCONF}"/init/*.sh; do
if [ "$f" != "/quay-registry/conf/init/runmigration.sh" ]; then
echo "Running init script '$f'"
ENSURE_NO_MIGRATION=true "$f" || exit
fi
done
exec supervisord -c "${QUAYCONF}/supervisord.conf" 2>&1
;;
"registry")
if [ -z "${QUAY_SERVICES}" ]; then
echo "Running all default registry services"