summaryrefslogtreecommitdiff
path: root/ausbutler-single.sh
blob: d6d84f81470424990c01eb10d36ee6977f5e114d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
set -eu
TOURNAMENT=$1
cd "$(dirname "$0")"

echo "Processing $TOURNAMENT..."

mkdir -p config

set -o allexport
source configs/_common.env
source configs/$TOURNAMENT.env
set +o allexport

ls config.template | while read CONFIGFILE
do
    envsubst < config.template/$CONFIGFILE > config/$CONFIGFILE
done

mkdir -p ${LIGA_AUSBUTLER_OUTPUT_PATH}

python jfrteamy-ausbutler/butler.py calculate generate nowait

if command -v lftp &> /dev/null
then
    lftp -f config/send.lftp
fi

rm config/*

echo "Done"