c4k-website/infrastructure/build/image/resources/entrypoint.sh

33 lines
722 B
Bash
Raw Permalink Normal View History

#!/bin/bash
2024-03-11 13:41:15 +00:00
mkdir $BUILDDIR
mkdir $SOURCEDIR
set -euo pipefail
source /usr/local/bin/functions.sh
filename="website.zip"
hashfilename="hashfile"
echo "Check for new content"
2024-03-11 13:41:15 +00:00
touch $HASHFILEDIR/$hashfilename
currentHash=$( cat $HASHFILEDIR/$hashfilename )
newHash=$( get-hash-data )
if [[ $currentHash == $newHash ]]
then
echo "Nothing to do"
2022-12-09 09:49:57 +00:00
else
2024-03-11 13:41:15 +00:00
echo $currentHash > $HASHFILEDIR/$hashfilename
echo "Generate .netrc file"
generate-netrc-file
echo "Downloading website data"
get-website-data $filename
unzip-website-data $filename
echo "Building website"
build-website
echo "Moving files"
move-website-files-to-target
fi