You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
c4k-website/infrastructure/c4k-website-build/image/resources/entrypoint.sh

52 lines
1.1 KiB
Bash

#!/bin/bash
mkdir $BUILDDIR
mkdir $SOURCEDIR
mkdir -p $HASHFILEDIR
set -o nounset
set -o xtrace
set -o errexit
set -eo pipefail
source /usr/local/bin/functions.sh
filename="website.zip"
hashfilename="hashfile"
touch $HASHFILEDIR/$hashfilename
# create empty hashfile
# download website data
# compare current hash to hashfile
# same?
# do nothing
# not same?
# overwrite hashfile with new hash
# unzip website
# execute scripts (if applicable)
# build website
# move files
echo "Downloading website data"
get-website-data $filename
echo "Check for new content"
currentHash=$( print-hash-from-file $filename )
if [[ $currentHash == $(cat $HASHFILEDIR/$hashfilename) ]]
then
echo "Nothing to do"
else
write-hashfile $currentHash $hashfilename
unzip-website-data $filename
echo "Executing Custom Scripts, if applicable"
execute-scripts-when-existing
echo "Building website"
build-website
echo "Moving files"
move-website-files-to-target
fi