Refactor minify-assets.sh script
What does this MR do and why?
Simplify the minify-assets.sh script so it's easier to understand and maintain.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
-
Configure a local GitLab Docs environment: https://gitlab.com/gitlab-org/gitlab-docs/-/blob/main/doc/setup.md. -
Check out branch. -
Run make clean && make compile. -
Run docker build -f dockerfiles/single.Dockerfile . --build-arg VER=15.10. It should succeed. -
Update minify-assets.shto make an invalid call. For example:-if $MINIFY_BIN "${MINIFY_FLAGS[@]}" --type=html --match="\.html$" -o "${TARGET}/${VER}/" "${TARGET}/${VER}"; then +if $MINIFY_BIN "${MINIFY_FLAGS[@]}" --type=html --matches="\.html$" -o "${TARGET}/${VER}/" "${TARGET}/${VER}"; then -
Run docker build -f dockerfiles/single.Dockerfile . --build-arg VER=15.10. It should fail. -
Run cd public. -
Run ../scripts/minify-assets.sh ./ ./. It should succeed.
Merge request acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this merge request.