container/hub: sync with script via file

Create a file in the hub container the share directory that will
signal to the outside that we are done with the setup.
This commit is contained in:
Christian Kellner 2020-09-10 12:02:31 +02:00 committed by Tom Gundersen
parent 7a366eca7a
commit 1effdc7a2c
2 changed files with 11 additions and 2 deletions

View file

@ -54,5 +54,8 @@ fi
# ensure /mnt/koji is owned by apache
chown -R apache:apache /mnt/koji
# signal we are ready via a file
touch /share/hub.init
# run apache
httpd -DFOREGROUND

View file

@ -114,8 +114,14 @@ koji_start() {
-e POSTGRES_HOST=org.osbuild.koji.postgres \
${KOJI_HUB_IMAGE}
# TODO: we need to wait for the database to be initialized here. A better method should be used.
sleep 2
# We need to wait for the database to be initialized here. The container creates a file to let us know
echo "Waiting for DB to be initialized"
while true; do
if [ -f ${SHARE_DIR}/hub.init ]; then
break
fi
sleep 2
done
# create koji users
# kojiadmin/kojipass - admin