This repository has been archived by the owner on Aug 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathdocker-compose-build.yaml
63 lines (63 loc) · 2.61 KB
/
docker-compose-build.yaml
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
# MODE=TEST DOCS_VERSION=$(cat contents/conf.py | grep -Po "(?<=^release\s=\s')[0-9.]*(?='$)") HOST_UID=$(id -u) docker-compose -f docker-compose-build.yaml up --exit-code-from datajoint-docs --build
#
# Intended for updating dependencies and docker image.
# Used to build release artifacts. MODE=TEST will build using single branch config passed
# into env variables i.e. faster. MODE=PROD will use all versions included in
# build_version.json.
version: "2.4"
services:
datajoint-docs:
build: .
image: datajoint/datajoint-docs:${DOCS_VERSION}
environment:
- PY_REPO=https://github.com/datajoint/datajoint-python.git
- PY_BRANCH=master
- M_REPO=https://github.com/datajoint/datajoint-matlab.git
- M_BRANCH=master
- DOCS_REPO=https://github.com/datajoint/datajoint-docs.git
- DOCS_BRANCH=master
- DOCS_BUILD_DIRECTORY=build
- DOCS_REF_DIRECTORY=build-ref
- MODE
user: ${HOST_UID}:anaconda
volumes:
- .:/home/anaconda/datajoint-docs
entrypoint:
- sh
- -lc
- |
# fail fast
set -e
# initialize with image entrypoint
/entrypoint.sh
# configure build
cp datajoint-docs/build_config_template.py datajoint-docs/build_config.py
sed -i "s|https://REPLACE-HERE-WITH-PATH-TO-COMMON-DOC.git|$${DOCS_REPO}|g" \
datajoint-docs/build_config.py
sed -i "s|REPLACE-HERE-WITH-COMMON-BRANCH|$${DOCS_BRANCH}|g" \
datajoint-docs/build_config.py
sed -i "s|https://REPLACE-HERE-WITH-PATH-TO-MATLAB-DOC.git|$${M_REPO}|g" \
datajoint-docs/build_config.py
sed -i "s|REPLACE-HERE-WITH-MATLAB-BRANCH|$${M_BRANCH}|g" \
datajoint-docs/build_config.py
sed -i "s|https://REPLACE-HERE-WITH-PATH-TO-PYTHON-DOC.git|$${PY_REPO}|g" \
datajoint-docs/build_config.py
sed -i "s|REPLACE-HERE-WITH-PYTHON-BRANCH|$${PY_BRANCH}|g" \
datajoint-docs/build_config.py
sed -i 's|PATH-TO-LOCALLY-PLACED-MATLAB-FOLDER|../datajoint-matlab|g' \
datajoint-docs/build_config.py
sed -i 's|PATH-TO-LOCALLY-PLACED-PYTHON-FOLDER|../datajoint-python|g' \
datajoint-docs/build_config.py
# build for appropriate mode
if [ "$$MODE" = "PROD" ]; then
cd datajoint-docs
python3 build-all.py
else
git clone -b $${PY_BRANCH} --single-branch $${PY_REPO}
git clone -b $${M_BRANCH} --single-branch $${M_REPO}
cd datajoint-docs
python3 build-local.py
fi
echo "----- Finishing building '$${MODE}' build -----"
# run arguments
"$${@}"