From c0fab933a5a4e144654c01d30318d5a3d1ec71b7 Mon Sep 17 00:00:00 2001 From: binwiederhier Date: Thu, 16 Nov 2023 05:31:53 -0500 Subject: [PATCH] Build docs in venv --- .gitignore | 3 ++- Dockerfile-build | 6 ++++-- Makefile | 17 ++++++++++++----- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index b60c9b23..7cbb52ac 100644 --- a/.gitignore +++ b/.gitignore @@ -13,4 +13,5 @@ secrets/ node_modules/ .DS_Store __pycache__ -web/dev-dist/ \ No newline at end of file +web/dev-dist/ +venv/ diff --git a/Dockerfile-build b/Dockerfile-build index 6e96c7d4..a0608b12 100644 --- a/Dockerfile-build +++ b/Dockerfile-build @@ -11,7 +11,9 @@ RUN apt-get update && apt-get install -y \ && echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" >> /etc/apt/sources.list.d/nodesource.list \ && apt-get update \ && apt-get install -y \ - python3-pip nodejs \ + python3-pip \ + python3-venv \ + nodejs \ && rm -rf /var/lib/apt/lists/* WORKDIR /app @@ -23,7 +25,7 @@ RUN make docs-deps ADD ./mkdocs.yml . ADD ./docs ./docs RUN make docs-build - + # web ADD ./web/package.json ./web/package-lock.json ./web/ RUN make web-deps diff --git a/Makefile b/Makefile index 61f3a22c..a29fb4f5 100644 --- a/Makefile +++ b/Makefile @@ -95,6 +95,7 @@ docker-dev: --build-arg COMMIT=$(COMMIT) \ ./ + # Ubuntu-specific build-deps-ubuntu: @@ -103,21 +104,27 @@ build-deps-ubuntu: curl \ gcc-aarch64-linux-gnu \ gcc-arm-linux-gnueabi \ + python3 \ + python3-venv \ jq which pip3 || sudo apt-get install -y python3-pip + # Documentation docs: docs-deps docs-build -docs-build: .PHONY - mkdocs build +docs-venv: .PHONY + python3 -m venv ./venv -docs-deps: .PHONY - pip3 install -r requirements.txt +docs-build: docs-venv + (. venv/bin/activate && mkdocs build) + +docs-deps: docs-venv + (. venv/bin/activate && pip3 install -r requirements.txt) docs-deps-update: .PHONY - pip3 install -r requirements.txt --upgrade + (. venv/bin/activate && pip3 install -r requirements.txt --upgrade) # Web app