build-repo-site.sh Raw
1#!/bin/sh
2
3REPO=$1
4
5cd ~/repos/$REPO.git
6
7REVS=`git show-branch | perl -nle 'm/^\[([^\]]*)\]/; print $1'`
8
9TAGS=`git tag --sort=-taggerdate | head -n 5 | head -c -1 | tr '\n' ','`
10if [ -n "$TAGS" ]; then
11 REVS=$REVS,$TAGS
12fi
13
14if [ -n "$2" ]; then
15 REVS=$REVS,$2
16fi
17
18echo $REVS
19
20pgit \
21 -repo . \
22 -clone-url https://serve.example.com/$REPO.git \
23 -root-relative /$REPO/ \
24 -revs $REVS \
25 -out /var/lib/wwwroot/$REPO