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