#!/bin/sh
# waiting for the database to finish migration!
sleep 60

while [ -z $(docker ps -qf "name=emg-pvs_renderer") ]; do
    >&2 echo "Container is unavailable - sleeping"
    sleep 15
  done

while [ -z $(docker exec -i $(docker ps -qf "name=emg-pvs_registrar") python3 /var/www/pvs/dev/pvs_instance/manage.py id list) ]; do
  >&2 echo "Collection is not created yet - sleeping"
    sleep 20
  done