diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c6a57b069..41414958d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -86,15 +86,12 @@ build_front: pages: stage: test - image: alpine + image: python:3.6-alpine before_script: - cd docs script: - - apk --no-cache add py2-pip python-dev - pip install sphinx - - apk --no-cache add make - - make html - - mv _build/html/ ../public + - python -m sphinx . ../public artifacts: paths: - public diff --git a/dev.yml b/dev.yml index 2c102f3ae..8d2129bef 100644 --- a/dev.yml +++ b/dev.yml @@ -71,3 +71,12 @@ services: - ./api/funkwhale_api/media:/protected/media ports: - "0.0.0.0:6001:6001" + + docs: + build: docs + command: python serve.py + volumes: + - ".:/app/" + ports: + - '35730:35730' + - '8001:8001' diff --git a/docs/Dockerfile b/docs/Dockerfile new file mode 100644 index 000000000..1067eb8be --- /dev/null +++ b/docs/Dockerfile @@ -0,0 +1,4 @@ +FROM python:3.6-alpine + +RUN pip install sphinx livereload +WORKDIR /app/docs diff --git a/docs/serve.py b/docs/serve.py new file mode 100644 index 000000000..9a381c74b --- /dev/null +++ b/docs/serve.py @@ -0,0 +1,13 @@ +#!/usr/bin/env python +from subprocess import call +# initial make +call(["python", "-m", "sphinx", ".", "/tmp/_build"]) +from livereload import Server, shell + +server = Server() +server.watch('.', shell('python -m sphinx . /tmp/_build')) +server.serve( + root='/tmp/_build/', + liveport=35730, + port=8001, +host='0.0.0.0')