From 5341ee4472e0f9067b5391d918dda38f77e99c46 Mon Sep 17 00:00:00 2001 From: kaiyou Date: Tue, 25 Sep 2018 21:04:30 +0200 Subject: [PATCH 1/6] Add a Dockerfile for buliding the docs --- docs/Dockerfile | 13 +++++++++++++ docs/requirements.txt | 1 - 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 docs/Dockerfile diff --git a/docs/Dockerfile b/docs/Dockerfile new file mode 100644 index 00000000..a850a664 --- /dev/null +++ b/docs/Dockerfile @@ -0,0 +1,13 @@ +FROM python:3-alpine + +RUN apk add --no-cache git + +COPY docs/requirements.txt requirements.txt +RUN pip install -r /requirements.txt \ + && mkdir /src + +WORKDIR /src +COPY .git /src/.git + +RUN sphinx-versioning build -b -B 1.5 -r 1.5 -w '^[0-9.]*$' -w master -W '^$' /src /build + diff --git a/docs/requirements.txt b/docs/requirements.txt index 2572817f..98338e63 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -3,4 +3,3 @@ Sphinx sphinx-autobuild sphinx-rtd-theme sphinxcontrib-versioning -paramiko From 72cfadd5e8d722b0a4b7e039c6f095c10241fb69 Mon Sep 17 00:00:00 2001 From: kaiyou Date: Tue, 25 Sep 2018 21:08:04 +0200 Subject: [PATCH 2/6] Build the docs during tests --- tests/build.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/build.yml b/tests/build.yml index 674abf8c..308b821a 100644 --- a/tests/build.yml +++ b/tests/build.yml @@ -45,3 +45,9 @@ services: none: image: mailu/none:$VERSION build: ../core/none + + docs: + image: mailu/docs:$VERSION + build: + context: ../ + dockerfile: ../docs/Dockerfile From 69c19dca55f321e95d66fa5d6f9aaa1a4ad3fa42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20M=C3=B6hlmann?= Date: Thu, 27 Sep 2018 21:45:06 +0300 Subject: [PATCH 3/6] Attempt to fix the docs build context --- tests/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/build.yml b/tests/build.yml index 308b821a..ff08de5d 100644 --- a/tests/build.yml +++ b/tests/build.yml @@ -50,4 +50,4 @@ services: image: mailu/docs:$VERSION build: context: ../ - dockerfile: ../docs/Dockerfile + dockerfile: docs/Dockerfile From 339b3c1b24c7821c91f7090fb3a714efb328947f Mon Sep 17 00:00:00 2001 From: kaiyou Date: Fri, 28 Sep 2018 10:41:17 +0200 Subject: [PATCH 4/6] Build the documentation as a Docker image --- docs/Dockerfile | 13 +++++++------ docs/conf.py | 25 ++----------------------- docs/nginx.conf | 5 +++++ docs/requirements.txt | 1 - tests/build.yml | 4 +--- 5 files changed, 15 insertions(+), 33 deletions(-) create mode 100644 docs/nginx.conf diff --git a/docs/Dockerfile b/docs/Dockerfile index a850a664..af481a27 100644 --- a/docs/Dockerfile +++ b/docs/Dockerfile @@ -1,13 +1,14 @@ FROM python:3-alpine -RUN apk add --no-cache git +COPY requirements.txt /requirements.txt -COPY docs/requirements.txt requirements.txt RUN pip install -r /requirements.txt \ - && mkdir /src + && apk add --no-cache nginx \ + && mkdir /run/nginx -WORKDIR /src -COPY .git /src/.git +COPY ./nginx.conf /etc/nginx/conf.d/default.conf +COPY . /docs -RUN sphinx-versioning build -b -B 1.5 -r 1.5 -w '^[0-9.]*$' -w master -W '^$' /src /build +RUN sphinx-build /docs /build +CMD nginx -g "daemon off;" \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py index 7a378132..f89b39fd 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -7,7 +7,7 @@ templates_path = ['_templates'] source_suffix = '.rst' master_doc = 'index' project = 'Mailu' -copyright = '2017, Mailu authors' +copyright = '2018, Mailu authors' author = 'Mailu authors' version = release = 'latest' language = None @@ -23,7 +23,7 @@ htmlhelp_basename = 'Mailudoc' # to template names. html_sidebars = { '**': [ - 'relations.html', # needs 'show_related': True theme option to display + 'relations.html', 'searchbox.html', ] } @@ -36,24 +36,3 @@ html_context = { 'github_version': 'master', 'conf_py_path': '/docs/' } - - -# Upload function when the script is called directly -if __name__ == "__main__": - import os, sys, paramiko - build_dir, hostname, username, password, dest_dir = sys.argv[1:] - transport = paramiko.Transport((hostname, 22)) - transport.connect(username=username, password=password) - sftp = paramiko.SFTPClient.from_transport(transport) - os.chdir(build_dir) - for dirpath, dirnames, filenames in os.walk("."): - remote_path = os.path.join(dest_dir, dirpath) - try: - sftp.mkdir(remote_path) - except: - pass - for filename in filenames: - sftp.put( - os.path.join(dirpath, filename), - os.path.join(remote_path, filename) - ) diff --git a/docs/nginx.conf b/docs/nginx.conf new file mode 100644 index 00000000..75b5be50 --- /dev/null +++ b/docs/nginx.conf @@ -0,0 +1,5 @@ +server { + listen 80; + listen [::]:80; + root /build; +} diff --git a/docs/requirements.txt b/docs/requirements.txt index 98338e63..4afd9bb6 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -2,4 +2,3 @@ recommonmark Sphinx sphinx-autobuild sphinx-rtd-theme -sphinxcontrib-versioning diff --git a/tests/build.yml b/tests/build.yml index ff08de5d..c39b0af4 100644 --- a/tests/build.yml +++ b/tests/build.yml @@ -48,6 +48,4 @@ services: docs: image: mailu/docs:$VERSION - build: - context: ../ - dockerfile: docs/Dockerfile + build: ../docs From 73add1b428450d78d68852369c670b8f199b4271 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20M=C3=B6hlmann?= Date: Mon, 1 Oct 2018 01:47:40 +0300 Subject: [PATCH 5/6] Documentation on running a local docs container --- docs/contributors/environment.rst | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/contributors/environment.rst b/docs/contributors/environment.rst index 0aac71f4..a1cce193 100644 --- a/docs/contributors/environment.rst +++ b/docs/contributors/environment.rst @@ -89,3 +89,20 @@ Any change to the files will automatically restart the Web server and reload the When using the development environment, a debugging toolbar is displayed on the right side of the screen, that you can open to access query details, internal variables, etc. + +Documentation +------------- + +Documentation is maintained in the ``docs`` directory and are maintained as `reStructuredText`_ files. It is possible to run a local documentation server for reviewing purposes, using Docker: + +.. code-block:: bash + + cd + docker build -t docs docs + docker run -p 127.0.0.1:8080:80 docs + +You can now read the local documentation by navigating to http://localhost:8080. + +.. note:: After modifying the documentation, the image needs to be rebuild and the container restarted for the changes to become visible. + +.. _`reStructuredText`: http://docutils.sourceforge.net/rst.html From c135b37b076c148597eb59c1dcb3b5d38fb144ee Mon Sep 17 00:00:00 2001 From: kaiyou Date: Sat, 6 Oct 2018 18:53:49 +0200 Subject: [PATCH 6/6] Enable mergify --- .mergify.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .mergify.yml diff --git a/.mergify.yml b/.mergify.yml new file mode 100644 index 00000000..27d34606 --- /dev/null +++ b/.mergify.yml @@ -0,0 +1,11 @@ +rules: + default: null + branches: + master: + protection: + required_status_checks: + strict: true + contexts: + - continuous-integration/travis-ci + required_pull_request_reviews: + required_approving_review_count: 2