Skip to content

Commit

Permalink
Add Makefile with shortcuts + updated theme file from the first try a…
Browse files Browse the repository at this point in the history
…t running the build
  • Loading branch information
benjaoming committed Aug 17, 2022
1 parent b654b40 commit 22ab0f9
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ sphinx_rtd_theme/static/fonts/RobotoSlab/
sphinx_rtd_theme/static/js/html5shiv.min.js
sphinx_rtd_theme/static/js/html5shiv-printshiv.min.js
.nvmrc

.container_id
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM python:2-alpine

RUN apk add --update npm

RUN mkdir -p /project/bin
RUN mkdir -p /project/src/

WORKDIR /project

Expand All @@ -21,6 +21,8 @@ RUN npm install --package-lock-only &&\
npm audit fix &&\
npm install

COPY webpack.common.js webpack.dev.js webpack.prod.js /project/

COPY docker-entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

Expand Down
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
SHELL := /bin/bash
CWD := $(shell cd -P -- '$(shell dirname -- "$0")' && pwd -P)

docker-images:
docker build -t sphinx_rtd_theme:latest .

docker-run:
rm -f .container_id
docker run --cidfile=.container_id --mount type=bind,source="$(CWD)/src",target=/project/src,readonly sphinx_rtd_theme:latest

docker-copy-assets:
docker cp "$(shell cat .container_id):/project/sphinx_rtd_theme" .
4 changes: 2 additions & 2 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

cp -R /git-readonly /git
cd /project

cd /git
npm run build

2 changes: 1 addition & 1 deletion sphinx_rtd_theme/static/css/theme.css

Large diffs are not rendered by default.

0 comments on commit 22ab0f9

Please sign in to comment.