summaryrefslogtreecommitdiffstats
path: root/generate-html-archive.sh
blob: bf835f09e9f359bb5aed6e956fa44c0f3a508949 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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.."