From fd034728471b70b0f610877211c501007156456d Mon Sep 17 00:00:00 2001 From: Zach van Rijn Date: Thu, 26 Aug 2021 13:41:33 -0500 Subject: Containerize all image conversions. Remove generation of tarball. --- publish | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/publish b/publish index 38c005e..5dc7424 100755 --- a/publish +++ b/publish @@ -3,7 +3,6 @@ HERE=$(dirname $(readlink -f ${0}))/src; HTML=html; -rm -f ${HTML}.tgz; TEMP=$(mktemp -d); chmod 755 ${TEMP}; @@ -17,17 +16,19 @@ chmod 755 ${TEMP}; # (cd assets/images && ./polyguin.sh) +#=============================================================== +docker run -v ${HERE}:${HERE} -e HERE=${HERE} -v ${TEMP}:${TEMP} -e TEMP=${TEMP} --rm -i alpine:3.14 <<'EOF' +apk add findutils imagemagick; +#=============================================================== + ## # .psd --> .jpg ONLY in 'src/' # -docker run -v$(pwd):/x -w/x --rm -i alpine:3.14 <<'EOF' -apk add imagemagick; find ${HERE} -type f -name "*.psd" | while read k; do f="${k#*${HERE}}"; mkdir -p "${TEMP}${f%/*}"; convert "${k}[0]" -strip "${TEMP}${f%*.psd}.jpg"; done -EOF ## # template injection @@ -47,6 +48,12 @@ find ${HERE} -type f -name "*.html" | while read k; do ; done +chown -R 1000:1000 ${TEMP}; + +#=============================================================== +EOF +#=============================================================== + ## # static assets # @@ -62,7 +69,6 @@ cp ${HERE}/robots.txt ${TEMP}; # ( cd ${TEMP}; - tar -pczf ../${HTML}.tgz .; ) ## -- cgit v1.2.3-70-g09d2