about summary refs log tree commit diff stats
path: root/tools/conf/srv/gitolite/hook-deployweb
diff options
context:
space:
mode:
Diffstat (limited to 'tools/conf/srv/gitolite/hook-deployweb')
-rwxr-xr-xtools/conf/srv/gitolite/hook-deployweb23
1 files changed, 23 insertions, 0 deletions
diff --git a/tools/conf/srv/gitolite/hook-deployweb b/tools/conf/srv/gitolite/hook-deployweb
new file mode 100755
index 0000000..a311c00
--- /dev/null
+++ b/tools/conf/srv/gitolite/hook-deployweb
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+######################################################################
+#
+# Put this file in your gitolite-admin;
+# ~/gitolite-admin/local/hooks/repo-specific/hook-deployweb
+#
+while read oldrev newrev refname
+do
+    BRANCH=$(git rev-parse --symbolic --abbrev-ref $refname)
+    echo "Commit was for branch $BRANCH"
+
+    if [[ "$BRANCH" == "master" ]];then
+
+        # Get project name from current directory (without .git)
+        PROJECT=$(basename "$PWD")
+        PROJECT=${PROJECT%.git}
+
+        echo "Project $PROJECT added to deploy list."
+        echo $PWD > /srv/gitolite/deploy/$PROJECT
+    fi
+
+done
19cca5d322'>^
1bf0c4a ^
b515765 ^

b515765 ^
292ccc4 ^
df74b26 ^


292ccc4 ^
df74b26 ^
8b4bc82 ^



39ffc18 ^
8b4bc82 ^



39ffc18 ^
df74b26 ^

8b4bc82 ^



39ffc18 ^
8b4bc82 ^



39ffc18 ^
df74b26 ^
b515765 ^

d6a6eca ^

b515765 ^

d6a6eca ^
e21d93b ^

b515765 ^
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57