This repository has been archived on 2025-09-04. You can view files and clone it, but cannot push or open issues or pull requests.
oshgit/build.sh

43 lines
1.1 KiB
Bash
Executable file

#!/bin/bash
# - Makes index for repositories in a single directory.
# - Makes static pages for each repository directory.
#
# NOTE, things to do manually (once) before running this script:
# - copy style.css, logo.png and favicon.png manually, a style.css example
# is included.
#
# - write clone url, for example "git://git.codemadness.org/dir" to the "url"
# file for each repo.
# - write owner of repo to the "owner" file.
# - write description in "description" file.
here=$(realpath $(dirname $0))
repos=$(realpath $here)/../*.git/
output=/var/www/html
echo Building repository list to $output
stagit-index $repos > $output/index.html
cp $here/style.css $output/style.css
cp $here/logo.png $output/logo.png
ln -sf $output/logo.png $output/favicon.png
for repo in ${@:-$repos}; do
dir="$output/$(basename $repo .git)"
repo=$(realpath $repo)
mkdir -p $dir
pushd $dir
echo Building html for $repo to $dir
stagit -c ".cache" $repo
ln -sf log.html index.html
ln -sf $output/style.css style.css
ln -sf $output/logo.png logo.png
ln -sf $output/logo.png favicon.png
popd
done
chgrp www-data $output -R
chmod 770 $output -R