Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 45 lines (32 sloc) 1.4 KB
set -e # break on error.
set -u # break on using undefined variable.
# Go to right place
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DIR
# Where are we?
echo "-- Clean old builds (if present)"
rm -rf ${APP_DIR}
echo "-- Build static site (hugo)"
docker run -i --rm -v `pwd`:/app chuyskywalker/hugo hugo --source="/app/jrmcc" --destination="/app/deploy/output" --baseUrl=""
echo "-- Minify the site html"
docker run -i --rm -v `pwd`/deploy:/src chuyskywalker/node-html-minifier \
find /src/output/ \( -iname "*.html" -or -iname "*htm" \) -exec bash -c 'echo " - {}"; html-minifier --config-file /src/html-minifier-config.json {} > {}.min; mv {}.min {}' \;
echo "-- Compressing (${EXT}) in ${APP_DIR}"
# fetch all source files by ${EXT} (extension) and pre-compress
find "$APP_DIR" -type f -regextype posix-extended \( -iregex ".*\.(${EXT})$" \) -print0 | while read -d '' sourceFile
gzip -c9 "${sourceFile}" > "${sourceFile}.gz"
echo " - ${sourceFile} > ${sourceFile}.gz"
echo "-- Build deployment container ($CNAME)"
cd deploy
docker build -t $CNAME .
echo "-- Deploying locally"
docker stop jrmcc-container 2>/dev/null || true
docker rm jrmcc-container 2>/dev/null || true
docker run -d --name jrmcc-container -p 8082:80
echo "-- Done!"
You can’t perform that action at this time.