#!/bin/bash

# Script for use by https://git-crysp.uwaterloo.ca/vvecna/lox-troll-patrol-extension/src/artifact

i="$1"

docker run --name tp-belarus-${i} --rm -d -i tp-analysis:latest || exit 1
docker exec tp-belarus-${i} sh -c "mkdir -p /home/analysis/belarus-2020-2021/data"
docker cp data/bridge-extra-infos-${i}.tar.xz tp-belarus-${i}:/home/analysis/belarus-2020-2021/data
docker exec tp-belarus-${i} sh -c "cd /home/analysis/belarus-2020-2021 && ./scripts/extract-extra-infos-archive.sh bridge-extra-infos-${i}.tar.xz"
docker cp tp-belarus-${i}:/home/analysis/belarus-2020-2021/data/bridge_data/bridge-extra-infos-${i}_processed.tar.xz data/ && docker stop tp-belarus-${i}
