-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathinit.sh
More file actions
executable file
·106 lines (102 loc) · 2.51 KB
/
init.sh
File metadata and controls
executable file
·106 lines (102 loc) · 2.51 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#!/bin/bash
function clone_repo {
if [ -d "$1" ]; then
echo 'Skipped: already exists.'
else
git clone --recursive https://github.com/${2:-PeterJCLaw}/$1
fi
}
for POSSIBLE_PYTHON in python3.14 python3.13 python3.12 python3.11 python3.10 python3 python;
do
PYTHON=$(which $POSSIBLE_PYTHON)
$PYTHON --version 2>&1 | grep -E 'Python (3\.)' >/dev/null
if [ $? -eq 0 ]; then
echo "Found Python: $PYTHON"
break
else
PYTHON=
fi
done
if [ -z "$PYTHON" ]; then
echo "No suitable Python installation found."
exit 1
fi
if [ -f /etc/lsb-release ]; then
if grep 'Ubuntu 14\.04' /etc/lsb-release; then
DODGY_UBUNTU=1
fi
fi
# Check that yarn is installed
yarn --version
if [ $? -ne 0 ]; then
npm --version
if [ $? -ne 0 ]; then
echo "npm not installed. Install it through your system package manager."
exit 1
fi
echo "yarn not installed. Please install it:"
echo "$ npm install -g yarn"
exit 1
fi
set -e
if [ -n "$DODGY_UBUNTU" ]; then
echo "Using /usr/bin/virtualenv due to Ubuntu 14.04's broken Python 3.4"
/usr/bin/virtualenv -p "$PYTHON" venv
else
"$PYTHON" -m venv venv
fi
source venv/bin/activate
set -v
pip install -U setuptools pip
pip install -r requirements.txt
clone_repo ranker
clone_repo srcomp
clone_repo srcomp-http
clone_repo srcomp-screens
clone_repo dummy-comp
clone_repo srcomp-scorer
clone_repo srcomp-cli
clone_repo srcomp-stream
clone_repo srcomp-kiosk
clone_repo srcomp-puppet
clone_repo livestream-overlay srobo
cd ranker
pip install -e .
cd ..
cd srcomp
pip install -e .
cd ..
cd srcomp-http
pip install -e .
cd ..
cd srcomp-scorer
pip install -e .
cd ..
cd srcomp-cli
pip install -e .
cd ..
cd srcomp-screens
yarn install
python -c '
import sys, json
print(json.dumps({
**json.load(sys.stdin),
"apiurl": "http://localhost:5112/comp-api",
"streamurl": "http://localhost:5001/"
}, indent=2))' <config.example.json >config.json
cd ..
cd srcomp-stream
sed 's_SRCOMP: .*_SRCOMP: "http://localhost:5112/comp-api"_' <config.local.coffee.example >config.local.coffee
npm install
cd ..
cd livestream-overlay
npm install
npm run build
sed 's_streamServerURI.*_streamServerURI = "http://localhost:5001/";_;
s_apiURI.*_apiURI = "http://localhost:5112/comp-api/";_' settings.example.js >settings.js
cd ..
set +v
echo "-- DONE SETUP --"
echo "Usage: "
echo " (1) Activate the virtualenv: source venv/bin/activate"
echo " (2) Run everything with run.py"