Commit fd034728 authored by Zach van Rijn's avatar Zach van Rijn
Browse files

Containerize all image conversions. Remove generation of tarball.

parent 84c99d78
......@@ -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 .;
)
##
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment