example_create.sh (1160B)
1#!/bin/sh
2# - Makes index for repositories in a single directory.
3# - Makes static pages for each repository directory.
4#
5# NOTE, things to do manually (once) before running this script:
6# - copy style.css, logo.png and favicon.png manually, a style.css example
7# is included.
8#
9# - write clone URL, for example "git://git.codemadness.org/dir" to the "url"
10# file for each repo.
11# - write owner of repo to the "owner" file.
12# - write description in "description" file.
13#
14# Usage:
15# - mkdir -p htmldir && cd htmldir
16# - sh example_create.sh
1718
# path must be absolute.
19reposdir="/var/www/domains/git.codemadness.nl/home/src"
20curdir="$(pwd)"
2122
# make index.
23stagit-index "${reposdir}/"*/ > "${curdir}/index.html"
2425
# make files per repo.
26for dir in "${reposdir}/"*/; do
27# strip .git suffix.
28r=$(basename "${dir}")
29d=$(basename "${dir}" ".git")
30printf "%s... " "${d}"
3132
mkdir -p "${curdir}/${d}"
33cd "${curdir}/${d}" || continue
34stagit -c ".cache" -u "https://git.codemadness.nl/$d/" "${reposdir}/${r}"
3536
# symlinks
37ln -sf log.html index.html
38ln -sf ../style.css style.css
39ln -sf ../logo.png logo.png
40ln -sf ../favicon.png favicon.png
4142
echo "done"
43done