-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
50 lines (35 loc) · 1.5 KB
/
setup.sh
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
#!/usr/bin/env bash
. /autograder/source/env.sh
. /autograder/source/envVars.sh
mkdir -p /root/.ssh
cp /autograder/source/ssh_config /root/.ssh/config
# Make sure to include your private key here
cp /autograder/source/deploy_keys/deploy_key /root/.ssh/deploy_key
# To prevent host key verification errors at runtime
ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
ssh-keyscan -t rsa github.ucsb.edu >> ~/.ssh/known_hosts
# Clone autograder files
mkdir -p ${BASE_DIR}/${REPO_NAME}
git clone ${GIT_REPO} ${BASE_DIR}/${REPO_NAME}
# If there is an apt-get.sh file in the repo, install what is needed
if [ -f ${BASE_DIR}/${REPO_NAME}/apt-get.sh ]; then
echo "Installing Linux requirements from ${GIT_REPO}/apt-get.sh"
chmod u+x ${BASE_DIR}/${REPO_NAME}/apt-get.sh
${BASE_DIR}/${REPO_NAME}/apt-get.sh
else
echo "No apt-get.sh found in repo"
fi
# If there is a requirements.txt file in the repo, Install python dependencies
if [ -f ${BASE_DIR}/${REPO_NAME}/requirements.txt ]; then
echo "Installing Python requirements from ${GIT_REPO}/requirements.txt"
pip install -r ${BASE_DIR}/${REPO_NAME}/requirements.txt
else
echo "No requirements.txt found in repo"
fi
# If there is a requirements.txt file in the repo, Install python dependencies
if [ -f ${BASE_DIR}/${REPO_NAME}/requirements3.txt ]; then
echo "Installing Python3 requirements from ${GIT_REPO}/requirements3.txt"
pip3 install -r ${BASE_DIR}/${REPO_NAME}/requirements3.txt
else
echo "No requirements3.txt found in repo"
fi