mirror of
https://github.com/burrow-dev/burrow-server.git
synced 2026-11-18 17:27:50 -05:00
fix(deploy): restart after a push of many files
update.sh piped git diff --name-only straight into grep -q; grep stops at
the first match, so with a long list git hit a broken pipe and pipefail
made the test false: "no restart needed" after 33f5607 (134 music files).
The list is now taken whole, then searched.
This commit is contained in:
1 parent
33f56074a4
commit
a359371a48
1 file changed
+6
-2
+6
-2
@@ -27,8 +27,12 @@ for file in $(git diff --name-only "$old" "$new" -- '*.js'); do
|
||||
fi
|
||||
done
|
||||
|
||||
# public/ is read from disk on every request; the rest is loaded once, at start
|
||||
if git diff --name-only "$old" "$new" | grep -qvE '^(public/|client-updates/|test/|tools/|deploy/|[^/]+\.md$|\.gitignore$)'; then
|
||||
# public/ is read from disk on every request; the rest is loaded once, at start.
|
||||
# the list is taken whole first: piped straight into grep -q, a long one (a
|
||||
# push of many files) had git cut off mid-write ("Broken pipe"), which
|
||||
# pipefail read as nothing to restart for.
|
||||
changed=$(git diff --name-only "$old" "$new")
|
||||
if grep -qvE '^(public/|client-updates/|test/|tools/|deploy/|[^/]+\.md$|\.gitignore$)' <<<"$changed"; then
|
||||
systemctl restart "$service"
|
||||
echo "updated $old -> $new, restarted $service"
|
||||
else
|
||||
|
||||
Reference in new issue
Block a user