#!/bin/bash
product_list_file=$1
echo "Starting registrar test"

IFS=","
./docker-stack-wait.sh -n renderer -n registrar -n preprocessor -n database -n sftp emg-pvs
docker exec -i $(docker ps -qf "name=emg-pvs_registrar") /wait-initialized.sh
docker exec -i $(docker ps -qf "name=emg-pvs_renderer") /wait-initialized.sh
while read product; do
    docker exec -e OS_PASSWORD=$OS_PASSWORD -i $(docker ps -qf "name=emg-pvs_registrar") \
        registrar register \
            --config-file /config.yaml \
            "$product"

done < "$product_list_file"


