Skip to content

Commit 52d274f

Browse files
committed
Captured the last of the current commit hooks. Fixes ietf-tools#3297. Commit ready for merge.
- Legacy-Id: 19058
1 parent cc3047e commit 52d274f

1 file changed

Lines changed: 30 additions & 22 deletions

File tree

hooks/post-commit

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@
4444
# http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/
4545

4646
# Log everything for debug, otherwise use explicit logging (further down)
47-
#[ "$LOGGING" ] || LOGGING=1 { exec $0 "$@" 2>&1 | logger -p local0.info -t "commit"; }
47+
#[ "$LOGGING" ] || LOGGING=1 { exec $0 "$@" 2>&1 | logger -p user.info -t "commit"; }
4848

49-
logger -p local0.info -t "hook" "${0##*/} $*"
49+
logger -p user.info -t "hook" "${0##*/} $*"
5050

5151
repo="$1"
5252
rev="$2"
@@ -56,16 +56,16 @@ program=${0##*/}
5656
progdir=${0%/*}
5757
thishost="$(/bin/hostname)"
5858
thishost="${thishost%%.*}"
59-
svnpath="/home/svn"
60-
trac="/www/tools.ietf.org/tools/ietfdb/"
61-
svn_url="https://svn.tools.ietf.org/svn/tools/ietfdb"
62-
trac_url="https://trac.tools.ietf.org/tools/ietfdb"
59+
svnpath="/a/svn/tools/ietfdb"
60+
trac="/a/www/www6s/trac/ietfdb/"
61+
svn_url="https://svn.ietf.org/svn/tools/ietfdb"
62+
trac_url="https://trac.ietf.org/trac/ietfdb"
6363

6464
# Do a local backup
65-
relpath=${repo#$svnpath/}
66-
bckpath="$svnpath/.backup/$thishost/$relpath"
67-
[ -d $bckpath ] || mkdir -p $bckpath
68-
/usr/bin/svn-fast-backup -q $repo $bckpath
65+
#relpath=${repo#$svnpath/}
66+
#bckpath="$svnpath/.backup/$thishost/$relpath"
67+
#[ -d $bckpath ] || mkdir -p $bckpath
68+
#/usr/bin/svn-fast-backup -q $repo $bckpath
6969

7070
# Inform trac about a new changeset
7171
trac-admin $trac changeset added ietfdb $rev
@@ -75,7 +75,7 @@ comments=$(/usr/bin/svnlook log $repo -r $rev)
7575
files=$(/usr/bin/svnlook changed $repo -r $rev)
7676

7777
dirs=$(/usr/bin/svnlook dirs-changed -r$rev $repo)
78-
logger -p local0.info -t "commit" "dirs '$dirs'"
78+
logger -p user.info -t "commit" "dirs '$dirs'"
7979

8080
# Look for 'requirements.txt' above the committed change. Looking only for
8181
# filechanges, not for dirchanges, filters out commits which are just tree
@@ -84,28 +84,36 @@ branch=$($progdir/svnfind --filechange --dirpath $repo $rev "requirements.txt")
8484

8585
if [ -n "$branch" ]; then
8686
# Update trac tickets
87-
/usr/bin/python $progdir/trac-post-commit-hook -p "$trac" -r "$rev" 2>&1 | logger -t "svn post-commit" -p "user.error" -i
87+
/usr/bin/python2.7 $progdir/trac-post-commit-hook -p "$trac" -r "$rev" 2>&1 | logger -t "svn post-commit" -p "user.error" -i
8888

8989
# Notify buildbot
90-
filenames=$(/usr/bin/svnlook changed $repo -r $rev | sed -r -e 's/^ *[^ ]+ +//' -e "s|$branch/||")
90+
# filenames=$(/usr/bin/svnlook changed $repo -r $rev | sed -r -e 's/^ *[^ ]+ +//' -e "s|$branch/||")
91+
# # Notify local build master
9192
/usr/local/bin/buildbot sendchange \
92-
--master="zinfandel.tools.ietf.org:9989" --auth="ietfdb:BRiR6XcT7x3$" \
93-
--who="$committer" --repository="https://svn.tools.ietf.org/svn/tools/ietfdb/" \
94-
--vc=svn --branch="$branch" --revision=$rev --property=xproperty:xvalue \
95-
--revlink="https://trac.tools.ietf.org/tools/ietfdb/changeset/$rev" \
96-
--comments="$comments" $filenames > /dev/null
93+
# --master="zinfandel.tools.ietf.org:9989" --auth="ietfdb:BRiR6XcT7x3$" \
94+
# --who="$committer" --repository="https://svn.tools.ietf.org/svn/tools/ietfdb/" \
95+
# --vc=svn --branch="$branch" --revision=$rev \
96+
# --revlink="https://trac.tools.ietf.org/tools/ietfdb/changeset/$rev" \
97+
# --comments="$comments" $filenames > /dev/null
98+
# Notify remote build master (must use the remote buildbot binary to match version)
99+
# ssh henrik@dunkelfelder.tools.ietf.org /usr/local/bin/buildbot sendchange \
100+
# --master="dunkelfelder.tools.ietf.org:9989" --auth="ietfdb:BRiR6XcT7x3$" \
101+
# --who="$committer" --repository="https://svn.tools.ietf.org/svn/tools/ietfdb/" \
102+
# --vc=svn --branch="$branch" --revision=$rev \
103+
# --revlink="https://trac.tools.ietf.org/tools/ietfdb/changeset/$rev" \
104+
# --comments="$comments" $filenames > /dev/null
97105

98106
fi
99107

100108

101109
# Log the commit
102-
logger -p local0.info -t "commit" "$relpath r$rev $committer"
103-
logger -p local0.info -t "commit" "branch: $branch"
110+
logger -p user.info -t "commit" "$relpath r$rev $committer"
111+
logger -p user.info -t "commit" "branch: $branch"
104112

105113
# Notify committers
106114

107115
if [[ $comments =~ ready.(for|to).merge ]]; then
108-
mail $(< $progdir/notify-email.txt) -s "[svnhook] Svn commit ready for merge: $relpath | $committer: ${comments:0:42}..." <<-EOF | logger -p local0.info -t "ready for merge email"
116+
mail $(< $progdir/notify-email.txt) -s "[svnhook] Svn commit ready for merge: $relpath | $committer: ${comments:0:42}..." <<-EOF | logger -p user.info -t "ready for merge email"
109117
110118
$committer has a commit ready for merge:
111119
$relpath/$branch [$rev]:
@@ -123,7 +131,7 @@ if [[ $comments =~ ready.(for|to).merge ]]; then
123131

124132
else
125133

126-
mail $(< $progdir/notify-email.txt) -s "[svnhook] Svn commit to $relpath | $committer: ${comments:0:42}..." <<-EOF | logger -p local0.info -t "commit email"
134+
mail $(< $progdir/notify-email.txt) -s "[svnhook] Svn commit to $relpath | $committer: ${comments:0:42}..." <<-EOF | logger -p user.info -t "commit email"
127135
128136
$committer has made a new SVN commit in
129137
$relpath/$branch [$rev]:

0 commit comments

Comments
 (0)