aboutsummaryrefslogtreecommitdiffstats
path: root/example-acit-list-projects.sh
blob: 0d69dcaf38155d3bcd6835740a64da6c486496a0 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh

# determine our domain
# NOTE: preferably hardcode the domain in your script, or use another env var
domain="${ACIT_MAIL_DOMAIN:-example.com}"
if [ -n "${ACIT_USES_ALIASES}" ]; then
	domain="${domain#bugs.}"
fi
domain="git.$domain"

# read project list
while read -r name; do
	printf "%s\thttps://%s/%s\n" "$name" "$domain" "$name"
done <<LIST
nocat
acit
work/cgit
softfork/cgit
LIST

:<<-DOC
For this example we use a hardcoded list. In production you're adviced
to use eg gitolite's project list that it exposes and cgit also reads.
example:

while read -r name; do
	# do magic
done </var/lib/git/projects.list

Of course you may use another language than bash, as long as you output
as a line per project, each line the projectname, a tab, the url for this
project.

DOC