-
Notifications
You must be signed in to change notification settings - Fork 2
/
entrypoint.sh
executable file
·43 lines (42 loc) · 1.22 KB
/
entrypoint.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
#!/bin/bash
if [ -z "$NBPORT" ]; then
NBPORT=8888
fi
if [ -z "$TOX_ARGS" ]; then
TOX_ARGS="doctest,coverage,pycodestyle,relint,codespell"
fi
if [ -n "$GIT_BRANCH" ]; then
echo "PULL from $GIT_BRANCH"
git pull -ff origin $GIT_BRANCH;
fi
make clean
sage setup.py install
case $1 in
test)
echo "Docker container running Sage doctests for the hilbertmodgroup package."
sage -t src
;;
tox)
echo "Docker container running tox with $TOX_ARGS"
sage -pip install tox
sage -python -m tox -c tox.ini -e $TOX_ARGS
;;
examples)
echo "Docker container with Jupyter Notebook interface to run example notebooks."
echo "NOTE: The Jupyter Notebook server is only accessible using the URL from outside the container."
sage -n jupyter --no-browser --ip='0.0.0.0' --port=$NBPORT\
--notebook-dir=examples\
--NotebookApp.custom_display_url=http://127.0.0.1:$NBPORT\
--NotebookApp.use_redirect_file=False\
--NotebookApp.browser=x-www-browser
;;
run)
sage
;;
shell)
/bin/bash
;;
*)
echo "Unknown command $1. Exiting..."
;;
esac