forked from datajoint/datajoint-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
36 lines (36 loc) · 1.43 KB
/
docker-compose.yaml
File metadata and controls
36 lines (36 loc) · 1.43 KB
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
# MODE="LIVE|QA|BUILD" PACKAGE=datajoint UPSTREAM_REPO=https://github.com/datajoint/datajoint-python.git docker compose up --build
services:
docs:
build:
# some docs need to be dynamically generated from the datajoint PACKAGE
context: ..
dockerfile: docs/Dockerfile
image: datajoint-python-docs
environment:
MODE: ${MODE:-LIVE} # specify mode: LIVE, QA, BUILD
# specify package to generate API docs
PACKAGE: ${PACKAGE:-datajoint}
UPSTREAM_REPO: ${UPSTREAM_REPO:-https://github.com/datajoint/datajoint-python.git}
volumes:
- ..:/main
ports:
- 8000:8000
command:
- bash
- -c
- |
set -e
if echo "$${MODE}" | grep -i live &>/dev/null; then
mkdocs serve --config-file /main/docs/mkdocs.yaml -a 0.0.0.0:8000
elif echo "$${MODE}" | grep -iE "qa|build" &>/dev/null; then
git branch -D gh-pages || true
git fetch $${UPSTREAM_REPO} gh-pages:gh-pages || true
mike deploy --ignore-remote-status --config-file /main/docs/mkdocs.yaml -u $$(grep -oP '\d+\.\d+' /main/$${PACKAGE}/version.py) latest
# mike set-default --config-file /main/docs/mkdocs.yaml latest
if echo "$${MODE}" | grep -i qa &>/dev/null; then
mike serve --config-file /main/docs/mkdocs.yaml -a 0.0.0.0:8000
fi
else
echo "Unexpected mode..."
exit 1
fi