-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·73 lines (56 loc) · 1.95 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/bash
# Run this script as root once upon VM initialization to set up the course manager infrastructure.
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
fi
if [[ ! -e "$HOME/credentials.sh" ]]; then
echo "Credentials are required at ~/credentials.sh for the course robot. Please see credentials.sh.template for the format."
fi
if [[ ! -e "$HOME/user_credentials.sh" ]]; then
echo "Credentials are required at ~/user_credentials.sh to initialize the course. It will be removed after the setup. Please see user_credentials.sh.template for the format."
fi
if [[ ! -e "$HOME/id_rsa" ]]; then
echo "A private key is required for the course robot to function."
fi
if [[ ! -e "$HOME/general.yaml" ]]; then
echo "general.yaml is required to configure the semester."
fi
# Use bash strict mode.
set -eux
set -o pipefail
# Change shell to bash to avoid any potential complications with legacy scripts.
echo "dash dash/sh boolean false" | debconf-set-selections
DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash
# Update package list.
apt-get update
# Shell
apt-get install -y mosh
# Build tools
apt-get install -y make python3-setuptools
# Development tools
apt-get install -y git tig npm nodejs
# Piazza image creation
apt-get install -y imagemagick
# LaTeX
apt-get install -y texlive-full
# Install pygithub
rm -rf pygithub_build
mkdir pygithub_build
pushd pygithub_build
wget https://github.com/PyGithub/PyGithub/archive/c5988c3980753edde628f86c2a5e84e5e4c2cc33.zip -O output.zip
unzip output.zip
cd PyGithub-*
python3 setup.py install
popd
rm -rf pygithub_build
# taft/handlebars
npm install -g taft
PATH=$HOME/.npm-packages/bin:$PATH
npm install --save -g handlebars-helpers
npm i handlebars-helper-moment --save-dev -g
npm install handlebars-fs --save -g
# taft has "#!/usr/bin/env node", so symlink a 'node' binary.
ln -s /usr/bin/nodejs /usr/local/bin/node
# Continue in user-mode setup.
sudo -H -u ubuntu ./setup_user.sh