#!/bin/bash

set -xe

if [ "$Environment" = "qa" ]; then

python feed_ingestion/bin/exec_flows.py apple_music_streams --skip $SKIP --days $DAYS --check-status --context '{"licensor": "sme"}'
python feed_ingestion/bin/exec_flows.py apple_music_streams --skip $SKIP --days $DAYS --check-status --context '{"licensor": "theorchard"}'
python feed_ingestion/bin/exec_flows.py apple_music_streams --skip $SKIP --days $DAYS --check-status --context '{"licensor": "awal", "snowflake_error_limit": 20}'

elif [ "$Environment" = "prod" ]; then

python feed_ingestion/bin/exec_flows.py apple_music_streams --skip $SKIP --days $DAYS --check-status --context '{"licensor": "theorchard", "build_dbt": "True", "snowflake_error_limit": 20}'
python feed_ingestion/bin/exec_flows.py apple_music_streams --skip $SKIP --days $DAYS --check-status --context '{"licensor": "sme", "build_dbt": "True", "snowflake_error_limit": 20}'
python feed_ingestion/bin/exec_flows.py apple_music_streams --skip $SKIP --days $DAYS --check-status --context '{"licensor": "awal", "snowflake_error_limit": 20}'

else
 echo "Environment does not have matching information" && exit 1
fi

