aboutsummaryrefslogtreecommitdiffstats
path: root/example-acit-list-projects.sh
diff options
context:
space:
mode:
Diffstat (limited to 'example-acit-list-projects.sh')
-rwxr-xr-xexample-acit-list-projects.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/example-acit-list-projects.sh b/example-acit-list-projects.sh
new file mode 100755
index 0000000..80f81d4
--- /dev/null
+++ b/example-acit-list-projects.sh
@@ -0,0 +1,36 @@
+#!/usr/bin/bash
+
+# determine our domain
+# NOTE: preferably hardcode the domain in your script, or use another env var
+domain="${ACIT_MAIL_DOMAIN:-example.com}"
+if [[ -v "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
+work/linux
+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
+
+