example_create.sh (1189B) - raw
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 17 18 # path must be absolute. 19 #reposdir="/var/www/domains/git.codemadness.nl/home/src" 20 reposdir="/home/git/repos" 21 curdir="$(pwd)" 22 23 # make index. 24 stagit-index "${reposdir}/"*/ > "${curdir}/index.html" 25 26 # make files per repo. 27 for dir in "${reposdir}/"*/; do 28 # strip .git suffix. 29 r=$(basename "${dir}") 30 d=$(basename "${dir}" ".git") 31 printf "%s... " "${d}" 32 33 mkdir -p "${curdir}/${d}" 34 cd "${curdir}/${d}" || continue 35 stagit -c ".cache" -u "https://git.samirparikh.com/$d/" "${reposdir}/${r}" 36 37 # symlinks 38 ln -sf log.html index.html 39 ln -sf ../style.css style.css 40 ln -sf ../logo.png logo.png 41 ln -sf ../favicon.png favicon.png 42 43 echo "done" 44 done