Fix Groovy escaping in find commands
Lint, build, test and deploy / build (push) Successful in 3m49s
Lint, build, test and deploy / test (push) Successful in 7s
Lint, build, test and deploy / deploy (push) Successful in 6s
Hexo-Butterfly/pipeline/head There was a failure building this commit

This commit is contained in:
Discharge7443 committed 2026-12-04 17:52:53 -08:00
1 parent 3998cbe008
commit c4e79860d1
1 file changed
+2 -2
Vendored
+2 -2
View File
@@ -26,8 +26,8 @@ pipeline {
#!/bin/bash #!/bin/bash
set -eu set -eu
apt-get update -qq && apt-get install -y -qq pngquant jpegoptim apt-get update -qq && apt-get install -y -qq pngquant jpegoptim
find public -type f -name '*.png' -exec sh -c 'pngquant --quality=80-95 --strip --force --skip-if-larger --output "$1" "$1"' _ {} \; find public -type f -name '*.png' -exec sh -c 'pngquant --quality=80-95 --strip --force --skip-if-larger --output "$1" "$1"' _ {} \\;
find public -type f \( -name '*.jpg' -o -name '*.jpeg' \) -exec jpegoptim --max=90 --strip-all --threshold=5 -q {} \; find public -type f \\( -name '*.jpg' -o -name '*.jpeg' \\) -exec jpegoptim --max=90 --strip-all --threshold=5 -q {} \\;
echo "site size after optimization: $(du -sh public | cut -f1)" echo "site size after optimization: $(du -sh public | cut -f1)"
EOS EOS
docker run --rm -v "$PWD:/site" -w /site -v /tmp/optimize.sh:/optimize.sh node:22 bash /optimize.sh docker run --rm -v "$PWD:/site" -w /site -v /tmp/optimize.sh:/optimize.sh node:22 bash /optimize.sh