Skip to content

Commit 014e069

Browse files
Merge branch 'develop' into 'main'
Add minimized JSON schema files See merge request libremfg/b2mml-batchml!2
2 parents 9ca9c71 + 092ab9f commit 014e069

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

Dockerfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
FROM alpine:latest AS build
33

44
# Install the Hugo go app.
5-
RUN apk add --update hugo
5+
RUN apk add --update hugo jq
66

77
# Set Working directory
88
WORKDIR /opt/b2mml-batchml
@@ -19,6 +19,12 @@ RUN mkdir ./Docs/static/schemas && \
1919
sed -i 's,\("$id"\: *"\),\1'"$HOST"'schemas/,g' ./Docs/static/schemas/*.json && \
2020
sed -i 's,\("$ref"\: *"\)\./,\1'"$HOST"'schemas/,g' ./Docs/static/schemas/*.json
2121

22+
# Minimize the JSON Schema files.
23+
RUN for f in ./Docs/static/schemas/*.json; do \
24+
path=${f%.json}.min.json && \
25+
(jq -c . < ./$f) > $path; \
26+
done
27+
2228
# Run Hugo in the Workdir to generate HTML.
2329
RUN hugo -s ./Docs -b ${HOST}
2430

0 commit comments

Comments
 (0)