From de1270af7c3159a721ee590d1ed8e8d91f8b628b Mon Sep 17 00:00:00 2001 From: Michal Zimniewicz Date: Fri, 23 Feb 2018 23:21:51 +0100 Subject: add scripts --- .gitmodules | 3 +++ scripts/generate-all.sh | 27 +++++++++++++++++++++++++++ scripts/jfrteamy-playoff | 1 + scripts/setup.sh | 9 +++++++++ 4 files changed, 40 insertions(+) create mode 100644 .gitmodules create mode 100755 scripts/generate-all.sh create mode 160000 scripts/jfrteamy-playoff create mode 100755 scripts/setup.sh diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..94869c4 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "scripts/jfrteamy-playoff"] + path = scripts/jfrteamy-playoff + url = https://github.com/emkael/jfrteamy-playoff.git diff --git a/scripts/generate-all.sh b/scripts/generate-all.sh new file mode 100755 index 0000000..f6e64e0 --- /dev/null +++ b/scripts/generate-all.sh @@ -0,0 +1,27 @@ +#!/bin/bash +set -e + +cd "$(dirname "$0")"/jfrteamy-playoff +python=venv/bin/python + +# level = 1 or 2 +# group = "n" or "nw" or "se" or ... +generate_playoff () { + rm -f playoff.html + level=$1 + group=$2 + echo "Generating $level$group..." + $python playoff.py ../../$level$group.json + echo "Uploading $level$group..." + scp playoff.html pzbs:~/liga/${level}liga/$group/playoff.html + rm -f playoff.html + echo "Done" +} + +generate_playoff 1 n +generate_playoff 1 s +generate_playoff 2 nw +generate_playoff 2 ne +generate_playoff 2 se +generate_playoff 2 sw + diff --git a/scripts/jfrteamy-playoff b/scripts/jfrteamy-playoff new file mode 160000 index 0000000..7d8b36b --- /dev/null +++ b/scripts/jfrteamy-playoff @@ -0,0 +1 @@ +Subproject commit 7d8b36b7f2a3a75eaf0c1ce15a2c567d6fc2fb1d diff --git a/scripts/setup.sh b/scripts/setup.sh new file mode 100755 index 0000000..216cfa2 --- /dev/null +++ b/scripts/setup.sh @@ -0,0 +1,9 @@ +#!/bin/bash +set -e +cd "$(dirname "$0")"/jfrteamy-playoff + +if [ ! -d venv ]; then + virtualenv venv +fi +venv/bin/pip install -r requirements.txt + -- cgit v1.2.3