PYROS_DOCKER_INSTALL 782 Bytes
#!/usr/bin/env bash

# if no container is running
if ! [ $(docker ps | grep 'pyros' | wc -l) -eq 2 ]
then
    echo "db_pyros or pyros weren't running, starting them..."
    ./PYROS_DOCKER_START.bat
fi

# while db container isn't ready to execute queries, wait 5 seconds
if ! docker inspect db_pyros --format='{{.State.Health.Status}}' | grep -q 'healthy'
then
    echo "db service isn't ready yet, waiting until it's ready..."
fi
while ! docker inspect db_pyros --format='{{.State.Health.Status}}' | grep -q 'healthy'
do
    sleep 5
    heal_status=$(docker inspect db_pyros --format='{{.State.Health.Status}}')
    echo "Current status : $heal_status"
done

# db container is ready to execture queries, we can start the installation
docker exec -it pyros python3 pyros.py install