Commit ebceb423 authored by Dom Sekotill's avatar Dom Sekotill
Browse files

Use rsync for static files collection

Rsync is faster and produces better output.
parent 3eb99431
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@ RUN apt-get update \
	libjpeg62 \
	libpng16-16 \
	libzip4 \
	rsync \
 &&:


+18 −8
Original line number Diff line number Diff line
@@ -58,14 +58,24 @@ setup() {

collect_static()
{
	declare -a args=()
	for pattern in "${STATIC_PATTERNS[@]}"; do
		args+=(-o -iname "$pattern")
	done
	find -name static -prune \
		-o -name uploads -prune \
		-o -type f -not \( -iname '*.php' "${args[@]}" \) \
		-exec install -vD '{}' 'static/{}' \;
	local IFS=,
	declare -a flags=(flist stats remove del)
	test -t 1 && flags+=(progress2)
	printf -- '- %s\n' "${STATIC_PATTERNS[@]}" |
	rsync \
		--checksum \
		--delete-delay \
		--exclude-from=- \
		--exclude='*.php' \
		--exclude=static/ \
		--exclude=wp-content/uploads/ \
		--force \
		--info="${flags[*]}" \
		--noatime \
		--recursive \
		--relative \
		--times \
		. static/
}

for file in /etc/wordpress/**/*.conf; do