dockerfiles/gitolite-stagit/bin/build-stagit-index

28 lines
637 B
Plaintext
Raw Normal View History

2020-04-08 13:05:07 +02:00
#!/bin/sh
set -e
2021-01-03 21:07:21 +01:00
STAGIT_BASE="${STAGIT_BASE:-/var/lib/git/stagit}"
2020-04-08 13:05:07 +02:00
GL_REPO_BASE="${GL_REPO_BASE:-/var/lib/git/repositories}"
2021-01-03 21:07:21 +01:00
mk_index () {
gitolite list-phy-repos | \
gitolite access % stagit R any | \
awk \
-F'\t' \
-v d="${GL_REPO_BASE}" \
'{if ($3 !~ "DENIED") print d"/"$1".git"}' | \
xargs -r /usr/local/bin/stagit-index | \
sed 's|\(<a href=".*\)/log.html\(">\)|\1\2|' > \
"${1}/index.html"
}
if [ -n "${SITES}" ]; then
_i=1
for site in ${SITES}; do
mk_index "${STAGIT_BASE}-${site}"
done
else
mk_index "${STAGIT_BASE}"
fi