summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Widen <andreas@harmonicflow.org>2023-11-26 16:44:07 +0100
committerAndreas Widen <andreas@harmonicflow.org>2023-11-26 16:44:07 +0100
commit5971343497d2c20793ed5db2ed2e78d856ff77e0 (patch)
treede695e1196032fef33bc4f307bafdffdfd8ed63f
parent0df690cb4b5d7b8040be6a87d832e652d79b68a8 (diff)
downloadhf-web-main.tar.xz
hf-web-main.zip
Add helper script for creating html archive.main
Signed-off-by: Andreas Widen <andreas@harmonicflow.org>
-rw-r--r--.gitignore2
-rwxr-xr-xgenerate-html-archive.sh35
2 files changed, 36 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index dcaf716..335ec95 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1 @@
-index.html
+*.tar.gz
diff --git a/generate-html-archive.sh b/generate-html-archive.sh
new file mode 100755
index 0000000..bf835f0
--- /dev/null
+++ b/generate-html-archive.sh
@@ -0,0 +1,35 @@
+#!/bin/sh
+#
+# Generate html archive:
+
+# get todays date in format XXXX-XX-XX:
+DATE=`date +%Y-%m-%d`
+
+# archive file name:
+ARCHIVE_NAME="$DATE-hf-web-generated-html.tar.gz"
+
+# tmp directory where generated html will reside:
+TMP_DIR=/tmp/harmonicflow.org
+
+# make sure guix and related packages are installed properly:
+sudo apt install guix
+sudo guix package -m manifest.scm
+
+# make sure old tmp folder is deleted before proceeding:
+if [ ! -d "$TMP_DIR" ]; then
+ rm -rf $TMP_DIR
+ echo "Removed old '$TMP_DIR' dir.."
+fi
+
+# generate the raw html in /tmp/harmonicflow.org:
+LANG=en_US.UTF-8 HFGE_WEB_SITE_LOCAL=yes guix environment -C -m manifest.scm -E LANG -E HFGE_WEB_SITE_LOCAL --share=/tmp -- haunt build
+
+# make sure 'index.html' reside in public_html root too:
+cp $TMP_DIR/public_html/en/index.html $TMP_DIR/public_html/
+
+# create the archive:
+tar -cpvzf $ARCHIVE_NAME $TMP_DIR
+
+# and so it seems:
+echo "Done.."
+