overleaf/services/web/bin/compress_assets
Jakob Ackermann cc78541714 Merge pull request #5670 from overleaf/jpa-cdn-pre-compress
[web] cdn_upload: compress assets prior to uploading them to GCS

GitOrigin-RevId: a9b0970beb124d20bd2ffe21d30a674ffafd6258
2021-11-04 09:03:32 +00:00

14 lines
325 B
Bash
Executable file

#!/usr/bin/env bash
set -e -o pipefail
SCRIPT_PATH=$(realpath "${BASH_SOURCE[0]}")
SCRIPT_DIR=$(dirname "$SCRIPT_PATH")
pushd /tmp
find public/ -type d | sed 's!^!compressed/!' | xargs mkdir --parents
find public/ -type f -print0 \
| xargs --null --max-args 20 --max-procs 10 "$SCRIPT_DIR/compress_batch_of_assets"
popd