-
Notifications
You must be signed in to change notification settings - Fork 12
/
sync
executable file
·74 lines (61 loc) · 2.38 KB
/
sync
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
#!/bin/bash
set -e
# there's rate limiting on the server logins, so we need sleeps
DELAY=3
MPT_ZIP="MyPyTutor351.zip"
printf "Downloading hash files..."
sftp csse1001.zones.eait.uq.edu.au >/dev/null 2>&1 << EOF
get /opt/local/share/MyPyTutor/MPT3_CSSE1001/data/submissions/tutorial_hashes
get /opt/local/share/MyPyTutor/MPT3_CSSE1001/data/submissions/tutorial_hash_mappings
EOF
printf "done\n"
printf "Building tutorial package..."
make > /dev/null
printf "done\n"
printf "Uploading new hash files..."
sleep $DELAY
sftp csse1001.zones.eait.uq.edu.au >/dev/null 2>&1 << EOF
put tutorial_hashes /opt/local/share/MyPyTutor/MPT3_CSSE1001/data/submissions/tutorial_hashes
put tutorial_hash_mappings /opt/local/share/MyPyTutor/MPT3_CSSE1001/data/submissions/tutorial_hash_mappings
EOF
printf "done\n"
printf "Uploading tutorials zip..."
sleep $DELAY
sftp csse1001.zones.eait.uq.edu.au >/dev/null 2>&1 << EOF
put CSSE1001Tutorials/CSSE1001Tutorials.zip /opt/local/share/MyPyTutor/MPT3_CSSE1001/public/CSSE1001Tutorials.zip
EOF
printf "done\n"
printf "Creating MyPyTutor zip..."
rm -f $MPT_ZIP
cd code && find tutorlib -name "*.py" | xargs zip ../$MPT_ZIP MyPyTutor.py{,w} >/dev/null && cd ..
printf "done\n"
printf "Uploading MyPyTutor zip..."
sleep $DELAY
sftp csse1001.zones.eait.uq.edu.au >/dev/null 2>&1 << EOF
put $MPT_ZIP /opt/local/share/MyPyTutor/MPT3_CSSE1001/public/$MPT_ZIP
EOF
printf "done\n"
printf "Updating version info..."
VERSION_FILE=.tmp_mpt_version
python3 code/MyPyTutor.py --version > $VERSION_FILE
sleep $DELAY
sftp csse1001.zones.eait.uq.edu.au >/dev/null 2>&1 << EOF
put $VERSION_FILE /opt/local/share/MyPyTutor/MPT3_CSSE1001/mpt_version
EOF
rm $VERSION_FILE
printf "done\n"
printf "Uploading installer..."
sleep $DELAY
sftp csse1001.zones.eait.uq.edu.au >/dev/null 2>&1 << EOF
put code/MyPyTutor.py /opt/local/share/MyPyTutor/MPT3_CSSE1001/public/MyPyTutor.py
put run_in_python3.bat /opt/local/share/MyPyTutor/MPT3_CSSE1001/public/run_in_python3.bat
EOF
printf "done\n"
printf "Updating cgi scripts..."
sleep $DELAY
rsync --delete --rsh=ssh -av --no-perms --omit-dir-times cgi-bin/ csse1001.zones.eait.uq.edu.au:/opt/local/libexec/cgi-bin/mpt3 >/dev/null 2>&1
printf "done\n"
printf "Updating help webpage..."
sleep $DELAY
rsync --delete --rsh=ssh -av --no-perms --omit-dir-times static/help/ csse1001.zones.eait.uq.edu.au:/opt/local/share/MyPyTutor/MPT3_CSSE1001/public/help >/dev/null 2>&1
printf "done\n"