-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
32 lines (24 loc) · 883 Bytes
/
setup.sh
File metadata and controls
32 lines (24 loc) · 883 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
#!/usr/bin/env bash
set -e
GO_VERSION="1.24.13"
# Check if custom_setup.sh exists and source it
if [ -f /autograder/source/custom_setup.sh ]; then
source /autograder/source/custom_setup.sh
fi
apt-get update && apt-get install -y wget rsync curl zip
# Define Go version to install
# Install Go
echo "Installing Go version $GO_VERSION..."
wget https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz -q -O /tmp/go.tar.gz
tar -C /usr/local -xzf /tmp/go.tar.gz
ln -s /usr/local/go/bin/go /usr/bin/go
# Create a user to run the student code in
adduser student --disabled-password --gecos ""
# Restrict permissions
mkdir -p /autograder/results
chmod 700 /autograder/results
mkdir -p /autograder/source
chmod -R 755 /autograder/source
# Build the test_runner program
(cd /autograder/source/src/test_runner && go build -o /autograder/test_runner .)
chmod +x /autograder/test_runner