pidgin/nest

Parents 494965ad0441
Children 79b80a6560e8
Run update-lastmod script while building container image

This will make sure that the creation date and last modified date of each markdown file matches to what the repository history says

Testing Done:
Built container image and verified the added script was indeed getting triggered.
Verified that the script was actually modified the markdown files with the correct creation and last updated date.

Bugs closed: NEST-44

Reviewed at https://reviews.imfreedom.org/r/521/
--- a/.dockerignore Sat Feb 20 19:44:35 2021 -0600
+++ b/.dockerignore Wed Mar 03 00:03:44 2021 -0600
@@ -1,5 +1,4 @@
.dockerignore
-.hg
.hgignore
.idea
.npmrc
--- a/Dockerfile Sat Feb 20 19:44:35 2021 -0600
+++ b/Dockerfile Wed Mar 03 00:03:44 2021 -0600
@@ -1,3 +1,20 @@
+#####################################################################
+# setup up our node environment
+#####################################################################
+
+FROM node:10-buster-slim as node-update-date
+WORKDIR /nest/
+COPY package-lock.json package.json ./
+RUN apt-get update && \
+ apt-get install -y mercurial && \
+ apt-get clean && \
+ npm ci --production && \
+ npm cache clean --force
+COPY .hg /nest/.hg
+COPY hugo /nest/hugo
+COPY tools /nest/tools
+RUN node tools/update-lastmod.js
+
#####################################################################
# run the hugo build
#####################################################################
@@ -13,7 +30,7 @@
ARG BUILD_DATE
ARG COMMIT
-COPY hugo /nest/hugo
+COPY --from=node-update-date /nest/hugo /nest/hugo
RUN hugo -s /nest/hugo -d /nest/public && \
cp /nest/public/post/index.xml /nest/public/rss.xml
--- a/package-lock.json Sat Feb 20 19:44:35 2021 -0600
+++ b/package-lock.json Wed Mar 03 00:03:44 2021 -0600
@@ -1153,7 +1153,6 @@
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/front-matter/-/front-matter-3.0.1.tgz",
"integrity": "sha512-iCHZ7RZGE36uG58iIWp8zrhDi9BZjlDiRj7aRcGm45EIqrbK+u4KTAmRKLG3FOaVkFhZI5/29SUo7sMLzlQkcA==",
- "dev": true,
"requires": {
"js-yaml": "^3.10.0"
}