From d3a75b5f95aa1dfbb84972dd695b85933cd6eefc Mon Sep 17 00:00:00 2001 From: marcsello Date: Wed, 8 Apr 2020 21:54:04 +0200 Subject: [PATCH] added docs to CI pipeline --- .drone.yml | 27 +++++++++++++++++++++++---- docs/Dockerfile | 3 +++ docs/conf.py | 6 +++--- 3 files changed, 29 insertions(+), 7 deletions(-) create mode 100644 docs/Dockerfile diff --git a/.drone.yml b/.drone.yml index 0692293..9f8f59e 100644 --- a/.drone.yml +++ b/.drone.yml @@ -30,12 +30,31 @@ steps: - docker push "$DOCKER_USERNAME/consumer_api" - docker push "$DOCKER_USERNAME/consumer_api:$DRONE_BUILD_NUMBER" -- name: build_docs - image: python:3 +- name: make_docs + image: python:3.8 commands: - - pip3 install Sphinx + - pip3 install Sphinx sphinx_rtd_theme - pip3 install -r requirements.txt - - sphinx-quickstart + - cd docs + - make html + +- name: build_docs + image: docker:stable-dind + volumes: + - name: dockersock + path: /var/run + environment: + DOCKER_USERNAME: + from_secret: DOCKER_USERNAME + DOCKER_PASSWORD: + from_secret: DOCKER_PASSWORD + commands: + - cd docs + - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin + - docker build -t="$DOCKER_USERNAME/consumer-api-docs" . + - docker build -t="$DOCKER_USERNAME/consumer-api-docs:$DRONE_BUILD_NUMBER" . + - docker push "$DOCKER_USERNAME/consumer-api-docs" + - docker push "$DOCKER_USERNAME/consumer-api-docs:$DRONE_BUILD_NUMBER" - name: slack image: plugins/slack diff --git a/docs/Dockerfile b/docs/Dockerfile new file mode 100644 index 0000000..691c92e --- /dev/null +++ b/docs/Dockerfile @@ -0,0 +1,3 @@ +FROM nginx:latest + +COPY _build/html/ /usr/share/nginx/html \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py index 15cc577..5f67273 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -34,7 +34,7 @@ extensions = [ ] # Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] +templates_path = [] # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. @@ -47,9 +47,9 @@ exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -html_theme = 'alabaster' +html_theme = 'sphinx_rtd_theme' # 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 +html_static_path = [] \ No newline at end of file