imfreedom/docs.imfreedom.org

Add support for pulling docs out of zip files
default tip
10 months ago, Gary Kramlich
57cd6963bcbd
Parents 6e5799b09472
Children
Add support for pulling docs out of zip files

Testing Done:
Dropped `hasl.zip` in the `archives/` directory and verified it showed up in the final container. The hasl docs are going to be in another review request.

Also built with the `archives/` directory empty and verified it ran without issue.

Reviewed at https://reviews.imfreedom.org/r/2456/
  • +3 -0
    .hgignore
  • +10 -0
    Dockerfile
  • +1 -0
    convey.yml
  • --- a/.hgignore Mon Sep 05 22:15:09 2022 -0500
    +++ b/.hgignore Tue Jun 13 03:09:26 2023 -0500
    @@ -1,3 +1,6 @@
    syntax: regexp
    ^docs\/
    +syntax: glob
    +archives/*.zip
    +
    --- a/Dockerfile Mon Sep 05 22:15:09 2022 -0500
    +++ b/Dockerfile Tue Jun 13 03:09:26 2023 -0500
    @@ -1,5 +1,15 @@
    +FROM docker.io/nginx:alpine AS extractor
    +
    +COPY archives/ /archives/
    +
    +# alpine xargs doesn't have long flags, -r is don't run if input is empty, and
    +# n is max args.
    +RUN mkdir /docs && \
    + ls /archives/*.zip | xargs -r -n 1 unzip -d /docs
    +
    FROM docker.io/nginx:alpine
    COPY static/ /usr/share/nginx/html/
    COPY docs/ /usr/share/nginx/html/
    +COPY --from=extractor /docs/ /usr/share/nginx/html/
    --- a/convey.yml Mon Sep 05 22:15:09 2022 -0500
    +++ b/convey.yml Tue Jun 13 03:09:26 2023 -0500
    @@ -15,6 +15,7 @@
    dockerfile: Dockerfile
    tag: ${REGISTRY}/${REPOSITORY}:${TAG}
    files:
    + - archives
    - docs
    - static