f37 -> f39
[infrastructure.git] / scripts / post-commit
1 #!/bin/sh
2
3 # POST-COMMIT HOOK
4 #
5 # The post-commit hook is invoked after a commit.  Subversion runs
6 # this hook by invoking a program (script, executable, binary, etc.)
7 # named 'post-commit' (for which this file is a template) with the 
8 # following ordered arguments:
9 #
10 #   [1] REPOS-PATH   (the path to this repository)
11 #   [2] REV          (the number of the revision just committed)
12 #
13 # The default working directory for the invocation is undefined, so
14 # the program should set one explicitly if it cares.
15 #
16 # Because the commit has already completed and cannot be undone,
17 # the exit code of the hook program is ignored.  The hook program
18 # can use the 'svnlook' utility to help it examine the
19 # newly-committed tree.
20 #
21 # On a Unix system, the normal procedure is to have 'post-commit'
22 # invoke other programs to do the real work, though it may do the
23 # work itself too.
24 #
25 # Note that 'post-commit' must be executable by the user(s) who will
26 # invoke it (typically the user httpd runs as), and that user must
27 # have filesystem-level permission to access the repository.
28 #
29 # On a Windows system, you should name the hook program
30 # 'post-commit.bat' or 'post-commit.exe',
31 # but the basic idea is the same.
32
33 # The hook program typically does not inherit the environment of
34 # its parent process.  For example, a common problem is for the
35 # PATH environment variable to not be set to its usual value, so
36 # that subprograms fail to launch unless invoked via absolute path.
37 # If you're having unexpected problems with a hook program, the
38 # culprit may be unusual (or missing) environment variables.
39
40 # Here is an example hook script, for a Unix /bin/sh interpreter.# For more examples and pre-written hooks, see those in
41 # the Subversion repository at
42 # http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/ and
43 # http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/
44
45
46 REPOS="$1"
47 REV="$2"
48 MAILDEST="build@onelab.eu"
49 #FROM="$MAILDEST"
50 FROM="$(id -un)@svn.onelab.eu"
51 SUBJECT="svn.onelab.eu - check in:"
52
53 #/usr/share/doc/subversion-1.4.2/tools/hook-scripts/commit-email.pl \
54 #        --from "$FROM" \
55 #        -s "$SUBJECT" \
56 #        "$REPOS" "$REV" "$MAILDEST"
57
58 # using our customized commit email script
59 custom=/root/bin/commit-email.pl
60 standard=/usr/share/doc/subversion-1.4.2/tools/hook-scripts/commit-email.pl
61
62 if [ -x $custom ] ; then
63   script=$custom
64 else
65   script=$standard
66   SUBJECT="$SUBJECT (WARNING : Custom script lost !!!)"
67 fi
68
69 $script --from "$FROM" -s "$SUBJECT" --size-limit 102400 "$REPOS" "$REV" "$MAILDEST"
70
71 #log-commit.py --repository "$REPOS" --revision "$REV"
72
73 # this is the actual location of /root/bin (symlinked)
74 /root/1lab-scripts/auto-update.sh
75 # plc-devel is now dismantled
76 #[ -d /plc/devel/data/root/bin ] && sudo -u build /plc/devel/data/root/bin/auto-update.sh