mirror of
https://github.com/nikdoof/website-hugo.git
synced 2025-12-13 14:32:25 +00:00
Update deploy scripts
This commit is contained in:
@@ -16,6 +16,11 @@ THEMES="lhs lhs-retro"
|
|||||||
# Ensure the target folder exists
|
# Ensure the target folder exists
|
||||||
mkdir -p "${TARGET_FOLDER}"
|
mkdir -p "${TARGET_FOLDER}"
|
||||||
|
|
||||||
|
# Clear out target folder, and put a boilerplate index in while we're building
|
||||||
|
rm -rf ${TARGET_FOLDER}/*
|
||||||
|
INDEX_PAGE="${TARGET_FOLDER}/index.html"
|
||||||
|
echo "<meta http-equiv="refresh" content="5"><p>Deploying...</p>" > "${INDEX_PAGE}"
|
||||||
|
|
||||||
# Checkout a local bare copy, to speed up later checkouts
|
# Checkout a local bare copy, to speed up later checkouts
|
||||||
ORIGIN=$(git config --get remote.origin.url)
|
ORIGIN=$(git config --get remote.origin.url)
|
||||||
BARE_FOLDER=`mktemp -u -d`
|
BARE_FOLDER=`mktemp -u -d`
|
||||||
@@ -41,15 +46,14 @@ for BRANCH in $BRANCHES; do
|
|||||||
# Build to the destination folder
|
# Build to the destination folder
|
||||||
for THEME in $THEMES; do
|
for THEME in $THEMES; do
|
||||||
hugo --quiet ${HUGO_ARGUMENTS} -b "${BASE_URL}/${BRANCH}/${THEME}" -s "${TEMP_FOLDER}" -d "${TARGET_FOLDER}/${BRANCH}/${THEME}" -t "${THEME}"
|
hugo --quiet ${HUGO_ARGUMENTS} -b "${BASE_URL}/${BRANCH}/${THEME}" -s "${TEMP_FOLDER}" -d "${TARGET_FOLDER}/${BRANCH}/${THEME}" -t "${THEME}"
|
||||||
|
find "${TARGET_FOLDER}/${BRANCH}/${THEME}" -name "*.cgi" -exec chmod a+x {}\;
|
||||||
done
|
done
|
||||||
|
|
||||||
# Cleanup the temp folder
|
# Cleanup the temp folder
|
||||||
rm -rf "${TEMP_FOLDER}"
|
rm -rf "${TEMP_FOLDER}"
|
||||||
done
|
done
|
||||||
|
|
||||||
# Build the index page
|
# Build the full index page
|
||||||
INDEX_PAGE="${TARGET_FOLDER}/index.html"
|
|
||||||
|
|
||||||
echo -e "<h1>Branches</h1>\n<ul>" > "${INDEX_PAGE}"
|
echo -e "<h1>Branches</h1>\n<ul>" > "${INDEX_PAGE}"
|
||||||
for BRANCH in $BRANCHES; do
|
for BRANCH in $BRANCHES; do
|
||||||
echo " <li>${BRANCH} - " >> "${INDEX_PAGE}"
|
echo " <li>${BRANCH} - " >> "${INDEX_PAGE}"
|
||||||
|
|||||||
@@ -13,4 +13,4 @@ git pull
|
|||||||
hugo --quiet ${HUGO_ARGUMENTS} -b "${BASE_URL}" -d "${TARGET_FOLDER}" -t "lhs-retro"
|
hugo --quiet ${HUGO_ARGUMENTS} -b "${BASE_URL}" -d "${TARGET_FOLDER}" -t "lhs-retro"
|
||||||
|
|
||||||
# Make sure the CGI scripts are executable
|
# Make sure the CGI scripts are executable
|
||||||
find "${TARGET_FOLDER}" -name "*.cgi" -exec chmod a+x \;
|
find "${TARGET_FOLDER}" -name "*.cgi" -exec chmod a+x {}\;
|
||||||
Reference in New Issue
Block a user