2022-09-23 13:39:17 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2022-09-28 12:32:41 +00:00
|
|
|
mkdir $BUILDDIR
|
|
|
|
mkdir $SOURCEDIR
|
|
|
|
|
2022-11-11 12:27:28 +00:00
|
|
|
set -o nounset
|
|
|
|
set -o xtrace
|
|
|
|
set -o errexit
|
|
|
|
set -eo pipefail
|
|
|
|
|
2022-09-23 13:39:17 +00:00
|
|
|
source /usr/local/bin/functions.sh
|
|
|
|
|
2022-12-02 08:37:03 +00:00
|
|
|
filename="website.zip"
|
|
|
|
hashfilename="hashfile"
|
|
|
|
|
|
|
|
# download website data
|
|
|
|
# check if hashfile exists
|
|
|
|
# if yes
|
|
|
|
# hash the current file
|
|
|
|
# compare current hash to hashfile
|
|
|
|
# same?
|
|
|
|
# do nothing
|
|
|
|
# not same?
|
|
|
|
# overwrite hashfile with new hash
|
|
|
|
# start the website build
|
|
|
|
# if not
|
|
|
|
# hash the current file
|
|
|
|
# write the hashfile
|
|
|
|
# start the build
|
|
|
|
|
|
|
|
echo "Downloading website data"
|
|
|
|
get-website-data filename
|
|
|
|
echo "Check for new content"
|
|
|
|
if [[ -f $hashfile ]]
|
|
|
|
then
|
|
|
|
currentHash=$( sha256sum $SOURCEDIR/$filename | cut -d " " -f 1 > ~/$2 ) #ToDo: output of sh256sum without path to file?
|
|
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
write-hashfile $filename $hashfilename
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2022-11-11 12:08:55 +00:00
|
|
|
echo "Executing Custom Scripts, if applicable"
|
|
|
|
execute-scripts-when-existing
|
2022-09-28 12:32:41 +00:00
|
|
|
echo "Building website"
|
|
|
|
build-and-extract-website
|
|
|
|
echo "Moving files"
|
|
|
|
move-website-files-to-target
|