From 8cdaaf360a13e8c62698b9137f89453ca1b97901 Mon Sep 17 00:00:00 2001 From: Mara3l Date: Wed, 5 Feb 2025 11:08:35 +0100 Subject: [PATCH] feat: make api docs visible from docker compose --- docs/Dockerfile | 30 ++++++++++++++++++++++++++---- docs/config/_default/params.toml | 5 +++++ docs/config/public/params.toml | 10 +++++----- 3 files changed, 36 insertions(+), 9 deletions(-) diff --git a/docs/Dockerfile b/docs/Dockerfile index 169dfda64..9bf51ea0b 100644 --- a/docs/Dockerfile +++ b/docs/Dockerfile @@ -1,15 +1,37 @@ +FROM python:3.12-slim AS builder + +RUN apt-get update && apt-get install -y git make curl + +COPY scripts/script-requirements.txt /scripts/script-requirements.txt +COPY docs docs +COPY scripts/docs/ /docs +COPY gooddata-api-client /gooddata-api-client +COPY gooddata-sdk /gooddata-sdk +COPY gooddata-pandas /gooddata-pandas + +RUN pip install --no-cache-dir -r /scripts/script-requirements.txt + +WORKDIR /docs + +RUN python json_builder.py && \ + python python_ref_builder.py api_spec.toml data.json latest content/en && \ + mkdir versioned_docs/latest && \ + mv -f data.json ./versioned_docs/latest/data.json && \ + mv -f content/en/latest/links.json ./versioned_docs/latest/links.json + FROM node:20.18.0-bookworm-slim +COPY --from=builder /docs /docs + RUN apt-get update && \ apt-get install -y git make golang-go curl && \ npm install -g hugo-extended@0.117.0 && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* -COPY docs docs - -WORKDIR docs -RUN npm install +WORKDIR /docs +RUN npm install && \ + hugo mod get # accessible on http://localhost:1313/latest/ ENTRYPOINT ["hugo", "server", "--bind", "0.0.0.0"] diff --git a/docs/config/_default/params.toml b/docs/config/_default/params.toml index 249e2d8b5..35720edec 100644 --- a/docs/config/_default/params.toml +++ b/docs/config/_default/params.toml @@ -7,3 +7,8 @@ # - "latestTag" - docker image tag for the latest patch version. Must be changed # on every patch release of respective branch +[[versions]] + version = "Latest" + dirpath = "latest" + url = "/latest/" + productName = "Python SDK Latest" diff --git a/docs/config/public/params.toml b/docs/config/public/params.toml index f2ede805e..35720edec 100644 --- a/docs/config/public/params.toml +++ b/docs/config/public/params.toml @@ -7,8 +7,8 @@ # - "latestTag" - docker image tag for the latest patch version. Must be changed # on every patch release of respective branch -#[[versions]] -# version = "Latest" -# dirpath = "latest" -# url = "/latest/" -# productName = "Python SDK Latest" +[[versions]] + version = "Latest" + dirpath = "latest" + url = "/latest/" + productName = "Python SDK Latest"