forked from codechefPesuecc/CodeChef-PESUECC-Chapter
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall-runtimes.sh
More file actions
33 lines (29 loc) · 975 Bytes
/
Copy pathinstall-runtimes.sh
File metadata and controls
33 lines (29 loc) · 975 Bytes
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
#!/usr/bin/env sh
# Install the language runtimes CP Arena supports into the running Piston
# container. Run once after `docker compose up` (Piston stores packages on a
# volume, so this only needs re-running if that volume is removed).
#
# ./scripts/install-runtimes.sh
#
# List everything Piston can install: curl "$PISTON_URL/api/v2/packages"
set -e
PISTON="${PISTON_URL:-http://localhost:2000}"
install() {
echo "Installing $1 $2 ..."
curl -s -X POST "$PISTON/api/v2/packages" \
-H 'Content-Type: application/json' \
-d "{\"language\":\"$1\",\"version\":\"$2\"}"
echo
}
# The CP Arena languages (gcc covers both C and C++).
install gcc 10.2.0 # C / C++
install python 3.12.0 # Python
install java 15.0.2 # Java
install mono 6.12.0 # C#
install node 20.11.1 # JavaScript
install go 1.16.2 # Go
install rust 1.68.2 # Rust
install zig 0.10.1 # Zig
echo "Done. Installed runtimes:"
curl -s "$PISTON/api/v2/runtimes"
echo