File tree Expand file tree Collapse file tree 2 files changed +51
-1
lines changed Expand file tree Collapse file tree 2 files changed +51
-1
lines changed Original file line number Diff line number Diff line change @@ -114,4 +114,3 @@ dj_local_conf_old.json
114114** /* ~
115115** /#* #
116116** /. #*
117- docker-compose.y * ml
Original file line number Diff line number Diff line change 1+ # MODE="LIVE|QA|PUSH" PACKAGE=element_interface UPSTREAM_REPO=https://github.com/datajoint/element-interface.git HOST_UID=$(id -u) docker compose -f docs/docker-compose.yaml up --build
2+ #
3+ # navigate to http://localhost/
4+ version : " 2.4"
5+ services :
6+ docs :
7+ build :
8+ dockerfile : docs/.docker/Dockerfile
9+ context : ../
10+ args :
11+ - PACKAGE
12+ image : ${PACKAGE}-docs
13+ environment :
14+ - PACKAGE
15+ - UPSTREAM_REPO
16+ - MODE
17+ - GOOGLE_ANALYTICS_KEY
18+ - PATCH_VERSION
19+ volumes :
20+ - ../docs:/main/docs
21+ - ../${PACKAGE}:/main/${PACKAGE}
22+ user : ${HOST_UID}:anaconda
23+ ports :
24+ - 80:80
25+ command :
26+ - sh
27+ - -c
28+ - |
29+ git config --global --add safe.directory /main
30+ set -e
31+ export PATCH_VERSION=$$(cat /main/$${PACKAGE}/version.py | grep -oE '\d+\.\d+\.[a-z0-9]+')
32+ if echo "$${MODE}" | grep -i live &>/dev/null; then
33+ mkdocs serve --config-file ./docs/mkdocs.yaml -a 0.0.0.0:80
34+ elif echo "$${MODE}" | grep -iE "qa|push" &>/dev/null; then
35+ echo "INFO::Delete gh-pages branch"
36+ git branch -D gh-pages || true
37+ echo "INFO::Fetch upstream gh-pages"
38+ git fetch $${UPSTREAM_REPO} gh-pages:gh-pages && git switch gh-pages || git switch --orphan gh-pages && git commit --allow-empty -m "init commit"
39+ echo "INFO::mike"
40+ mike deploy --config-file ./docs/mkdocs.yaml -u $$(grep -oE '\d+\.\d+' /main/$${PACKAGE}/version.py) latest
41+ mike set-default --config-file ./docs/mkdocs.yaml latest
42+ if echo "$${MODE}" | grep -i qa &>/dev/null; then
43+ mike serve --config-file ./docs/mkdocs.yaml -a 0.0.0.0:80
44+ elif echo "$${MODE}" | grep -i push &>/dev/null; then
45+ echo "INFO::Push gh-pages to upstream"
46+ git push $${UPSTREAM_REPO} gh-pages
47+ fi
48+ else
49+ echo "Unexpected mode..."
50+ exit 1
51+ fi
You can’t perform that action at this time.
0 commit comments