SHA256
1
0

Make roles more reusable

This commit is contained in:
2026-01-29 02:49:52 -05:00
parent 4436599693
commit 44261c95fb
60 changed files with 1273 additions and 353 deletions

16
roles/scripts/update-git-hooks Executable file
View File

@@ -0,0 +1,16 @@
#!/usr/bin/env bash
# Update the post-receive hooks of multiple bare git repos
for i in /var/lib/git/gogs-repositories/bryan/*/hooks/post-receive; do
# Get repo name
rn="${i%/hooks/post-receive}"
rn="${rn##*/}"
# Don't duplicate the line if it already exists
while IFS= read -r line; do
[[ "$line" == "git push --mirror git@github.com:cryobry/${rn}" ]] && continue
done < "$i"
# Append the line
echo "git push --mirror git@github.com:cryobry/${rn}" >> "$i"
done