forked from DeathByDenim/gameserver
Update offline web deploy to use Jekyll too
This commit is contained in:
parent
cd86a54e25
commit
1ce13fcbb1
|
@ -0,0 +1,2 @@
|
||||||
|
.sass-cache/
|
||||||
|
web.tar.bz2
|
|
@ -23,18 +23,30 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
if ! which jekyll > /dev/null; then
|
||||||
|
echo "Jekyll is required to generate the website"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
webroot=${TMPDIR:-/tmp}/website
|
webroot=${TMPDIR:-/tmp}/website
|
||||||
mkdir -p ${webroot}
|
mkdir -p ${webroot}
|
||||||
cp -r "$(dirname "$0")"/website/[^_]* ${webroot}
|
cp -r "$(dirname "$0")"/website/* ${webroot}
|
||||||
for file in ${webroot}/*\.html ${webroot}/js/*\.js; do
|
|
||||||
sed -i $file -e s/"DOMAINNAME"/"${DOMAINNAME}"/g
|
curl --location https://github.com/twbs/bootstrap/archive/v5.2.3.zip > ${TMPDIR:-/tmp}/bootstrap.zip
|
||||||
done
|
unzip -o -d ${TMPDIR:-/tmp}/bootstrap ${TMPDIR:-/tmp}/bootstrap.zip "bootstrap-5.2.3/scss/*"
|
||||||
for file in ${webroot}/*\.html; do
|
if [ -d "$(dirname "$0")"/../website/_sass/bootstrap ]; then
|
||||||
sed -i $file -e s/"HOSTEDBYNAME"/"${HOSTEDBYNAME}"/g
|
rm -r "$(dirname "$0")"/../website/_sass/bootstrap
|
||||||
done
|
fi
|
||||||
for file in ${webroot}/*\.html; do
|
mv ${TMPDIR:-/tmp}/bootstrap/bootstrap-5.2.3/scss ${webroot}/_sass/bootstrap
|
||||||
sed -i $file -e "/SERVERSTATE/r $(dirname "$0")/website/_state/offline.html"
|
rm -r ${TMPDIR:-/tmp}/bootstrap.zip ${TMPDIR:-/tmp}/bootstrap
|
||||||
sed -i $file -e "/SERVERSTATE/d"
|
cat > ${webroot}/_config.yml <<EOF
|
||||||
done
|
content:
|
||||||
tar -cjf web.tar.bz2 --directory="${webroot}" .
|
hosted_by_name: "${HOSTEDBYNAME}"
|
||||||
|
domain_name: "${DOMAINNAME}"
|
||||||
|
offline: true
|
||||||
|
ssl: true
|
||||||
|
md5password: "$(echo -n "${systempassword}" | md5sum | cut -d' ' -f1)"
|
||||||
|
EOF
|
||||||
|
jekyll build --source ${webroot} --destination ${webroot}/_site
|
||||||
|
tar -cjf web.tar.bz2 --directory="${webroot}/_site" .
|
||||||
rm -rf "${webroot}"
|
rm -rf "${webroot}"
|
||||||
|
|
Loading…
Reference in New Issue