Skip to content
Snippets Groups Projects
Commit 25cf184b authored by Bryan BRANCOTTE's avatar Bryan BRANCOTTE
Browse files

build the doc using docker image

parent 73703f8f
No related branches found
No related tags found
2 merge requests!43K8S deployments of release branche, and other updates,!42build the doc
...@@ -78,9 +78,25 @@ pages: ...@@ -78,9 +78,25 @@ pages:
stage: deploy stage: deploy
dependencies: dependencies:
- test-pg - test-pg
services:
- registry-gitlab.pasteur.fr/dsi-tools/docker-images/docker:dind
script: script:
- mv ippisite/htmlcov public/ - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
- mv ippisite/docs/build/html/ public/ # pull the latest build on this branch
- docker pull "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG/web-container:latest" || true
# build the image while passing commit SHA and tagging the image with it
- cd ippisite
- docker build
--target docs-container
--build-arg CI_COMMIT_REF_SLUG
--build-arg CI_COMMIT_SHA
--cache-from "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG/web-container:latest"
--tag ippidb_docs
.
- mkdir build/
- docker run -v $(pwd)/build/:/code/docs/build/ ippidb_docs
- mv build/html/ ../public/
- mv ../htmlcov ../public/
artifacts: artifacts:
paths: paths:
- public - public
...@@ -237,4 +253,4 @@ delete-dev-deployment: ...@@ -237,4 +253,4 @@ delete-dev-deployment:
script: script:
- echo "Removing $CI_COMMIT_REF_SLUG" - echo "Removing $CI_COMMIT_REF_SLUG"
- helm delete -n ${NAMESPACE} ${CI_COMMIT_REF_SLUG} - helm delete -n ${NAMESPACE} ${CI_COMMIT_REF_SLUG}
- kubectl delete pvc -n ${NAMESPACE} -lapp.kubernetes.io/instance=${CI_COMMIT_REF_SLUG} - kubectl delete pvc -n ${NAMESPACE} -lapp.kubernetes.io/instance=${CI_COMMIT_REF_SLUG}
\ No newline at end of file
...@@ -9,6 +9,6 @@ ippidb.json ...@@ -9,6 +9,6 @@ ippidb.json
ippidb.json.gz ippidb.json.gz
db.json db.json
db.sql.gz db.sql.gz
db-django-4.0.sql.gz db*.sql.gz
persistent/media/* persistent/media/*
# END OF FILE # END OF FILE
\ No newline at end of file
############################################################################### ###############################################################################
# BAse image containing libs, dependencies and code # Base image containing libs, dependencies
############################################################################### ###############################################################################
FROM python:3.9 AS base-container FROM python:3.9 AS base-container-without-sources
EXPOSE 8000 EXPOSE 8000
ENV PYTHONPATH "${PYTHONPATH}:/usr/lib/python3/dist-packages" ENV PYTHONPATH "${PYTHONPATH}:/usr/lib/python3/dist-packages"
...@@ -16,6 +16,7 @@ RUN addgroup --gid 1000 kiwi \ ...@@ -16,6 +16,7 @@ RUN addgroup --gid 1000 kiwi \
gettext \ gettext \
python3-dev \ python3-dev \
python3-openbabel \ python3-openbabel \
graphviz-dev \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \
&& python -m pip install --upgrade pip setuptools \ && python -m pip install --upgrade pip setuptools \
&& mkdir /code && mkdir /code
...@@ -28,8 +29,13 @@ RUN pip install -r requirements.txt ...@@ -28,8 +29,13 @@ RUN pip install -r requirements.txt
COPY ./*-entrypoint.sh / COPY ./*-entrypoint.sh /
RUN chmod a+x /*-entrypoint.sh RUN chmod a+x /*-entrypoint.sh
COPY . /code/
###############################################################################
# Base image plus the sources
###############################################################################
FROM base-container-without-sources AS base-container
COPY . /code/
############################################################################### ###############################################################################
# django web app # django web app
...@@ -57,4 +63,22 @@ ENTRYPOINT ["/docker-celery-entrypoint.sh"] ...@@ -57,4 +63,22 @@ ENTRYPOINT ["/docker-celery-entrypoint.sh"]
CMD ["celery", "-A", "ippisite", "worker", "-l", "info", "--concurrency", "2"] CMD ["celery", "-A", "ippisite", "worker", "-l", "info", "--concurrency", "2"]
USER kiwi USER kiwi
\ No newline at end of file
###############################################################################
# build the docs
###############################################################################
FROM base-container-without-sources AS docs-container
ENV USE_SQLITE_AS_DB True
COPY requirements*.txt /code/
RUN pip install -r requirements-dev.txt \
&& mkdir -p /root/.config/bioservices
CMD ["make", "html" ]
COPY . /code/
WORKDIR /code/docs
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment