diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 491c383d4d00431d590bcca1766adf68fc199f52..c5db5e967c93343bc5eef2bd9418c7824bf0d57a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,16 +1,55 @@ -image: python:3.9-slim-buster -pages: - stage: deploy +stages: + # --- Docker build stage --- + # The first stage contains jobs used to build + # docker images 'ready to use' for build/install. + # Requirement for jobs in this stage : + # - should build and push a docker image to siconos project registry + # - should be allowed to failed (in order to avoid blocking of last stage jobs) + # - should run only when commit message contains [docker build] + # - use Dockerfile from ci_gitlab/dockerfiles/<image-name> + # + - docker-build + # --- Doc stages --- + # Build documentation (run doxygen, sphinx, ...) + - doc-build + # Publish html pages + - doc-deploy + + +ubuntu20.4-doc:docker-build: + variables: + IMAGE_NAME: ubuntu20.04-doc + image: + name: gcr.io/kaniko-project/executor:debug + entrypoint: [""] + variables: + GIT_STRATEGY: clone + stage: docker-build + script: + - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json + - sed -i "s|REGISTRY_PATH|$CI_PROJECT_PATH|g" $CI_PROJECT_DIR/ci/Dockerfile + - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile ci/Dockerfile --destination $CI_REGISTRY_IMAGE/$IMAGE_NAME:latest + rules: + - if: $CI_COMMIT_MESSAGE =~ /^\[docker-build\]/ + when: always + - when: never +# --- Build doc/web site and publish it --- +doc:build: + variables: + IMAGE_NAME: $CI_REGISTRY_IMAGE/ubuntu20.04-doc script: - - pip install -U sphinx - - pip install sphinx_rtd_theme - - pip install recommonmark - - sphinx-build -d _public/doctrees docs/ _build/html - - mv _build/html/* public + - sphinx-build -b html -d build/doctrees docs/ build + artifacts: + paths: + - build/ +pages: + image: python:alpine + script: + - mv build public artifacts: paths: - public - rules: - - if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH + stage: doc-deploy + needs: ["doc:build"] diff --git a/ci/Dockerfile b/ci/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..660d292b1793c5656e79fc11eebeaba2c4bfe92e --- /dev/null +++ b/ci/Dockerfile @@ -0,0 +1,15 @@ +FROM ubuntu:20.04 +ENV TZ=Europe/Paris +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && apt update && apt install -y -qq \ + ntp \ + git-core \ + make \ + vim \ + libpython3-dev \ + python3 \ + python3-pip \ + python3-packaging \ + graphviz doxygen texlive-latex-base && apt autoclean -y && apt autoremove -y&& rm -rf /var/lib/apt/lists/* +WORKDIR /home +COPY requirements4doc.txt /home +RUN pip3 install -U -r /home/requirements4doc.txt diff --git a/ci/requirements4doc.txt b/ci/requirements4doc.txt new file mode 100644 index 0000000000000000000000000000000000000000..934b639aa6b364df8646972525d4a10d4ce56077 --- /dev/null +++ b/ci/requirements4doc.txt @@ -0,0 +1,6 @@ +sphinx-rtd-theme +sphinxcontrib-bibtex +sphinxcontrib-websupport +sphinx-rtd-theme + + diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 0000000000000000000000000000000000000000..d0f1f96cd93a766fbab123e343168433f1204cd7 --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,55 @@ +# Configuration file for the Sphinx documentation builder. +# +# This file only contains a selection of the most common options. For a full +# list see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Path setup -------------------------------------------------------------- + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +# +# import os +# import sys +# sys.path.insert(0, os.path.abspath('.')) + + +# -- Project information ----------------------------------------------------- + +project = 'hysop' +copyright = '2021, hysop team' +author = 'hysop team' + +# The full version, including alpha/beta/rc tags +release = '1.0.0' + + +# -- General configuration --------------------------------------------------- + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ +] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path. +exclude_patterns = [] + + +# -- Options for HTML output ------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +html_theme = 'alabaster' + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] \ No newline at end of file diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 0000000000000000000000000000000000000000..f2f67a0a787b7a4501f5e151478af08ff2e9d820 --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,19 @@ +.. hysop documentation master file, created by + sphinx-quickstart on Thu Nov 4 13:58:20 2021. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to hysop's documentation! +================================= + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search`