-
Notifications
You must be signed in to change notification settings - Fork 8
/
build-student.sh
executable file
·31 lines (28 loc) · 838 Bytes
/
build-student.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
#!/bin/bash
#
# A convenience script that rebuilds all student notebooks
# and prepares a directory ./tmp/ with student notebooks
# and autograder directories.
cd "$(dirname "$0")"
set -ve
rm -rf tmp/
bazel build ...
mkdir -p tmp/
# Note: tar -i flag is important as these tar files were produced by
# concatenation of multiple tar files.
tar xvfi bazel-bin/autograder_tar.tar -C tmp
mkdir -p tmp/student
tar xvfi bazel-bin/student_tar.tar -C tmp/student
mkdir -p tmp/colab_student
tar xvfi bazel-bin/colab_student_tar.tar -C tmp/colab_student
if [ -f student ]; then
cp -v student/* tmp/student/
fi
if [ -f nbextensions ]; then
cp -rv nbextensions tmp/student/
if [ -n "$SERVER_URL" ]; then
perl -i -pe \
"s,http:https://localhost:8000/upload,$SERVER_URL/upload,g" \
tmp/student/nbextensions/upload_it/main.js
fi
fi